@happyvertical/smrt-ingestion 0.57.31 → 0.57.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EXTRACTION.md +15 -0
- package/PROPOSALS.md +77 -0
- package/dist/chunks/proposal-contracts-CqVVPvqq.js.map +1 -1
- package/dist/host-review.d.ts +19 -0
- package/dist/host-review.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/models.js +1 -1
- package/dist/models.js.map +1 -1
- package/dist/proposal-contracts.d.ts +26 -0
- package/dist/proposal-contracts.d.ts.map +1 -1
- package/dist/proposal-dto.d.ts +31 -0
- package/dist/proposal-dto.d.ts.map +1 -1
- package/dist/proposal-sdk.d.ts.map +1 -1
- package/dist/proposal-validation.d.ts +23 -0
- package/dist/proposal-validation.d.ts.map +1 -1
- package/dist/proposals.d.ts +8 -1
- package/dist/proposals.d.ts.map +1 -1
- package/dist/proposals.js +143 -6
- package/dist/proposals.js.map +1 -1
- package/dist/smrt-knowledge.json +10 -10
- package/dist/svelte/components/ReviewView.svelte +1 -0
- package/dist/svelte/components/ReviewView.svelte.d.ts.map +1 -1
- package/dist/svelte/i18n.d.ts +4 -0
- package/dist/svelte/i18n.d.ts.map +1 -1
- package/dist/svelte/i18n.js +4 -0
- package/package.json +13 -13
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-ingestion",
|
|
6
|
-
"packageVersion": "0.57.
|
|
6
|
+
"packageVersion": "0.57.33",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "422b9c3c2b30b79f996a9837b11049fe153685eb2db20c22a41818f9d770999d",
|
|
11
|
+
"packageJson": "fe8888c3fd70683007d5f483f8a90009de3e5e779bf540601075abe09e63d2dd",
|
|
12
12
|
"agents": "dea14442054ec1de798cba9be1fbdd955f44b0e4672639cbf3db8101d290c1fb",
|
|
13
13
|
"moduleDoc:agents/execution.md": "3b223cb3c85312a29bb6157f22b153b4d643dca790b149f47c35396f981f2dc7",
|
|
14
14
|
"moduleDoc:README.md": "49384c00608705488c26fb8c515c70cd7ba17a62d0b4c41ace2a821206011edd",
|
|
15
|
-
"moduleDoc:EXTRACTION.md": "
|
|
16
|
-
"moduleDoc:PROPOSALS.md": "
|
|
15
|
+
"moduleDoc:EXTRACTION.md": "a3683fcb13119bbe24fd05f4ae9c154fe366a6a0d3ea87a02f4e545b0ba3c890",
|
|
16
|
+
"moduleDoc:PROPOSALS.md": "1d1f50b75019c2330014eb21dcebba51549017fb4a4dd221f856168d7717db97",
|
|
17
17
|
"moduleDoc:FEEDBACK.md": "bf244222a1bc24843bdb7e94320dc3c0dfb7cb892001639d274786f4b667dacb",
|
|
18
18
|
"moduleDoc:REVIEW.md": "eb2714386988a15f762bdc726b1fb3aa85a08e97e9363317f39234ebceddedb0",
|
|
19
19
|
"agentSurface:src/test-support/execution.ts": "cc72288b2605fc687b820da558fa862da1bab799cebe4ee88b32be9e902618b8",
|
|
20
|
-
"agentSurface:src/test-support/proposals.ts": "
|
|
20
|
+
"agentSurface:src/test-support/proposals.ts": "52d33604f01a8a722ad7fec4077aa94a84813e75ac28a3cc84f3335725e12ef4"
|
|
21
21
|
},
|
|
22
22
|
"exports": [
|
|
23
23
|
".",
|
|
@@ -1715,12 +1715,12 @@
|
|
|
1715
1715
|
{
|
|
1716
1716
|
"path": "EXTRACTION.md",
|
|
1717
1717
|
"module": "EXTRACTION",
|
|
1718
|
-
"content": "# Extraction adapters\n\n`@happyvertical/smrt-ingestion/server` exports `createSDKExtractionAdapter`,\n`extractAnalysis`, extraction types, and `proposeDocumentSplits`. Root and DTO\nexports remain browser-safe. No extraction result authorizes a business action.\n\nHosts construct the SDK adapter with explicit provider/model/version identities\n(`unknown` for unavailable model/version), credential-bearing SDK options, and\n`nativeMemoryIsolation: 'host-enforced'`. This last setting is an assertion by\ntrusted deployment configuration, never a source/body/client option. Deploy the\nprovider child under an OS/container native-memory ceiling. Node's heap limit\ncannot bound native allocations, and PDF's renderer has no pre-render pixel\nlimit. Without that host guarantee, adapter construction refuses to run. A\nconfigured provider must be pinned, not `auto`; OCR fallback is disabled so\ncapability provenance cannot silently change. Identity objects are projected onto\nexactly `provider`, `model`, and `version`, each a required nonblank string. Extra\nhost fields never enter capability or segment identities, including through\ntrusted custom adapter results at the publication boundary.\n\nThe adapter forks one disposable Node process per retained part. Deadline or\ncancellation kills it (and its process group on POSIX); provider stdout/stderr\nare discarded. Calls are sequential and bounded by input bytes, page count,\nimage decode pixels, serialized output, vision tokens, elapsed time and Node\nheap. Native memory remains the host boundary described above. Remote compute\nalready accepted by a provider may continue/bill after the local process dies.\nDo not interpret a local cancellation as remote billing cancellation.\n\nPersist `{extraction: {configurationRevision, limits}}` using `service.analyze`,\nthen claim its lease. Call `extractAnalysis(service, lease, adapter, options)`\nwith exactly that revision and limits. The service reloads the immutable input\nsnapshot and rechecks current processing authority before each provider and\nbefore publication. The production child requests a parent-side authorization\nhandshake before each PDF/OCR/vision/speech operation, including calls on later\npages. Denial kills the child; already transmitted material cannot be recalled.\nCustom trusted adapters must await `request.beforeProviderCall` before every\nprovider invocation. Bytes are read through the service's integrity-checked\nreader; revoked, expired, foreign-scope, forged and stale leases fail closed.\nA retry keeps the same analysis input revision; changed provider/model/options\nmust use a new configuration revision and `analyze` request key. Credentials are\nnever placed in persisted configuration or provider identity.\n\nResults retain the original evidence ID/hash/part/parent references. Ordered\nsegments form whole-document context; extraction does not split originals into\nbusiness records. Valid UTF-8 JSON, text and HTML remain literal source text (render HTML\nonly through an application sanitizer). JSON syntax is validated without rewriting\nits source text; malformed JSON or UTF-8 fails extraction. PDF text is extracted one page at a\ntime, falling back to actual rendered-page OCR for empty pages. Embedded text\nis not evidence that every visual element was understood. TIFF is actually\ndecoded page-by-page with sharp to PNG; each result cites its original TIFF page.\nAnimated non-TIFF images are unsupported. Ordinary image OCR and scene vision\nare separately configured. Speech uses source-level text unless actual segment\ntimestamps are returned; absent speech confidence calibration is unknown.\n\nConfidence and boxes are explicitly null unless an OCR provider advertises and\nreturns them. Unlimited-OCR's synthetic common confidence is always discarded,\neven if an injected capability claims otherwise. Measured OCR values retain an\nunknown calibration label; they are not routing certainty or approval. Boxes\nare in decoded image pixels, attached only to that actual page/source. No tables\nare invented: the current PDF/OCR text APIs do not supply a table contract.\n\nThe persisted receipt's `maxOutputBytes`, exposed by `getAnalysisInput`, bounds\nthe complete serialized analysis envelope across all parts, including provenance,\ncapabilities, usage, and failure metadata. Extraction reserves room for a `limit`\noutcome and retains fitting earlier parts/segments when the aggregate is too\nlarge. Top-level `truncated` and `omittedEvidenceCount` identify publication\nomissions; per-result omissions retain every discarded segment's exact page or\ntime location. Existing errors and omitted ranges survive trimming unchanged.\nIf those diagnostic records cannot fit, the entire result is omitted rather than\npublishing an incomplete account of its known failures. If the ceiling\ncannot fit the minimum result envelope, no provider runs: `failAnalysis` records\nonly a fixed safe category and terminal lifecycle state, with no provider output\nor output digest. That service-owned failure accounting is outside the provider\npayload budget; `completeAnalysis` never accepts an oversized result.\n\nPartial page results survive later failures or process timeout. Warnings and\nomitted page/source references remain inspectable. `unsupported_type` covers\nvideo, unconfigured media and encrypted PDF; corrupt decoder failures without a\nsafe typed SDK category are `unavailable`, never raw exception strings. A host\ncan repair/reconfigure and create a fresh analysis without rewriting originals.\n`proposeDocumentSplits` produces a hashed, versioned, non-executable grouping of\nobserved pages; overlap, unordered groups and nonexistent pages are rejected.\n\n## Evidence and limitations\n\n`pnpm --filter @happyvertical/smrt-ingestion test:providers` runs actual local PDF\nSDK extraction, actual sharp multipage TIFF decoding, and packaged process/HTTP\nadapter lifecycle tests. The local speech server tests adapter transport and\ntermination, not transcription quality. The tiny TIFF fixture proves IFD/page\nmapping, not fax OCR accuracy. `extraction.test.ts` injects deterministic SDK\nboundaries for mixed/scanned PDF, Unlimited-OCR, camera observations, message\nattachments, audio timestamps and malformed/partial output. These fixtures are\nnot real remote-provider integrations and are not the ADR evaluation corpus.\n\nNo live Unlimited-OCR, speech recognition or vision quality run is claimed.\nNo recorded-human-audio recognition accuracy, real camera-scene quality,\ncalibrated confidence, table extraction, or automatic-action acceptance is\nestablished by these tests. Deployment owners must run the intended provider,\nmodel and representative retained corpus before making those claims. The\n[behavior matrix](../../docs/test-matrix/3672-ingestion-extraction.md) records the\nrelease commands and authority obligations.\n\nThe versioned on-disk corpus manifest records exact hashes for valid embedded,\nraster and mixed PDFs, two-page TIFF, a synthetic camera-format JPEG, a valid\nPCM WAV recording of a generated tone, email text, corrupt PDF and unsupported\nvideo. The tone is not human speech; the illustrated scene is not a photograph.\nReal local HTTP fixture runs execute Unlimited-OCR's installed SDK and speech\ntransport against deterministic responses/timeouts. They verify adapters, not\nremote models. Unlimited-OCR 0.61.6 rejects valid encoded images smaller than\n100 bytes; ingestion reports `unavailable` without altering them. This owning\nSDK defect is tracked in [happyvertical/ocr#143](https://github.com/happyvertical/ocr/issues/143).\n\nEach capability record explicitly reports `truncation` and `usage` as `unknown`\nor `reported`. Unlimited-OCR's current SDK discards upstream `finish_reason`\nand token usage, so both are `unknown` even for nonempty output. Downstream\nrules must not interpret `status: 'complete'` or `truncated: false` as proof of\nuntruncated OCR: they describe completed input processing and *detected*\ntruncation only. The adapter never bypasses the SDK to recover hidden fields.\nThe missing SDK metadata is tracked in [happyvertical/ocr#144](https://github.com/happyvertical/ocr/issues/144).\nAI vision retains reported truncation when supplied by its SDK. Missing provider\ncost is unknown, not zero; no cost estimate is invented.\n"
|
|
1718
|
+
"content": "# Extraction adapters\n\n`@happyvertical/smrt-ingestion/server` exports `createSDKExtractionAdapter`,\n`extractAnalysis`, extraction types, and `proposeDocumentSplits`. Root and DTO\nexports remain browser-safe. No extraction result authorizes a business action.\n\nHosts construct the SDK adapter with explicit provider/model/version identities\n(`unknown` for unavailable model/version), credential-bearing SDK options, and\n`nativeMemoryIsolation: 'host-enforced'`. This last setting is an assertion by\ntrusted deployment configuration, never a source/body/client option. Deploy the\nprovider child under an OS/container native-memory ceiling. Node's heap limit\ncannot bound native allocations, and PDF's renderer has no pre-render pixel\nlimit. Without that host guarantee, adapter construction refuses to run. A\nconfigured provider must be pinned, not `auto`; OCR fallback is disabled so\ncapability provenance cannot silently change. Identity objects are projected onto\nexactly `provider`, `model`, and `version`, each a required nonblank string. Extra\nhost fields never enter capability or segment identities, including through\ntrusted custom adapter results at the publication boundary.\n\nThe adapter forks one disposable Node process per retained part. Deadline or\ncancellation kills it (and its process group on POSIX); provider stdout/stderr\nare discarded. Calls are sequential and bounded by input bytes, page count,\nimage decode pixels, serialized output, vision tokens, elapsed time and Node\nheap. Native memory remains the host boundary described above. Remote compute\nalready accepted by a provider may continue/bill after the local process dies.\nDo not interpret a local cancellation as remote billing cancellation.\n\nPersist `{extraction: {configurationRevision, limits}}` using `service.analyze`,\nthen claim its lease. Call `extractAnalysis(service, lease, adapter, options)`\nwith exactly that revision and limits. The service reloads the immutable input\nsnapshot and rechecks current processing authority before each provider and\nbefore publication. The production child requests a parent-side authorization\nhandshake before each PDF/OCR/vision/speech operation, including calls on later\npages. Denial kills the child; already transmitted material cannot be recalled.\nCustom trusted adapters must await `request.beforeProviderCall` before every\nprovider invocation. Bytes are read through the service's integrity-checked\nreader; revoked, expired, foreign-scope, forged and stale leases fail closed.\nA retry keeps the same analysis input revision; changed provider/model/options\nmust use a new configuration revision and `analyze` request key. Credentials are\nnever placed in persisted configuration or provider identity.\n\nResults retain the original evidence ID/hash/part/parent references. Ordered\nsegments form whole-document context; extraction does not split originals into\nbusiness records. Valid UTF-8 JSON, text and HTML remain literal source text (render HTML\nonly through an application sanitizer). JSON syntax is validated without rewriting\nits source text; malformed JSON or UTF-8 fails extraction. PDF text is extracted one page at a\ntime, falling back to actual rendered-page OCR for empty pages. Embedded text\nis not evidence that every visual element was understood. TIFF is actually\ndecoded page-by-page with sharp to PNG; each result cites its original TIFF page.\nAnimated non-TIFF images are unsupported. Ordinary image OCR and scene vision\nare separately configured. Speech uses source-level text unless actual segment\ntimestamps are returned; absent speech confidence calibration is unknown.\n\nConfidence and boxes are explicitly null unless an OCR provider advertises and\nreturns them. Unlimited-OCR's synthetic common confidence is always discarded,\neven if an injected capability claims otherwise. Measured OCR values retain an\nunknown calibration label; they are not routing certainty or approval. Boxes\nare in decoded image pixels, attached only to that actual page/source. No tables\nare invented: the current PDF/OCR text APIs do not supply a table contract.\n\nThe persisted receipt's `maxOutputBytes`, exposed by `getAnalysisInput`, bounds\nthe complete serialized analysis envelope across all parts, including provenance,\ncapabilities, usage, and failure metadata. Extraction reserves room for a `limit`\noutcome and retains fitting earlier parts/segments when the aggregate is too\nlarge. Top-level `truncated` and `omittedEvidenceCount` identify publication\nomissions; per-result omissions retain every discarded segment's exact page or\ntime location. Existing errors and omitted ranges survive trimming unchanged.\nIf those diagnostic records cannot fit, the entire result is omitted rather than\npublishing an incomplete account of its known failures. If the ceiling\ncannot fit the minimum result envelope, no provider runs: `failAnalysis` records\nonly a fixed safe category and terminal lifecycle state, with no provider output\nor output digest. That service-owned failure accounting is outside the provider\npayload budget; `completeAnalysis` never accepts an oversized result.\n\nPartial page results survive later failures or process timeout. Warnings and\nomitted page/source references remain inspectable. `unsupported_type` covers\nvideo, unconfigured media and encrypted PDF; corrupt decoder failures without a\nsafe typed SDK category are `unavailable`, never raw exception strings. A host\ncan repair/reconfigure and create a fresh analysis without rewriting originals.\n`proposeDocumentSplits` produces a hashed, versioned, non-executable grouping of\nobserved pages; overlap, unordered groups and nonexistent pages are rejected.\n\n## Evidence and limitations\n\n`pnpm --filter @happyvertical/smrt-ingestion test:providers` runs actual local PDF\nSDK extraction, actual sharp multipage TIFF decoding, and packaged process/HTTP\nadapter lifecycle tests. The local speech server tests adapter transport and\ntermination, not transcription quality. The tiny TIFF fixture proves IFD/page\nmapping, not fax OCR accuracy. `extraction.test.ts` injects deterministic SDK\nboundaries for mixed/scanned PDF, Unlimited-OCR, camera observations, message\nattachments, audio timestamps and malformed/partial output. These fixtures are\nnot real remote-provider integrations and are not the ADR evaluation corpus.\n\n### Host OCR data\n\n`@happyvertical/pdf` probes its Kreuzberg provider on import and logs\n`Kreuzberg could not initialize Tesseract language 'eng'` when no `eng`\ntraineddata is found. Ingestion's suites do not route through Kreuzberg (PDF\nextraction uses `unpdf` or injected fixtures), so on its own this warning does\nnot explain a test failure. Hosts that run Kreuzberg OCR need Tesseract\nlanguage data: install `tesseract-ocr-eng` (Debian/Ubuntu) or `tesseract`\n(Homebrew), or place `eng.traineddata` from\n[tessdata_fast](https://github.com/tesseract-ocr/tessdata_fast) in a directory\nand export `TESSDATA_PREFIX` pointing at it. The SDK checks\n`TESSDATA_PREFIX`, then `tesseract --list-langs`, then the common\n`/usr/share`, `/usr/local/share` and Homebrew `tessdata` directories; on\nhosts without those paths (for example NixOS), set `TESSDATA_PREFIX`.\n\nNo live Unlimited-OCR, speech recognition or vision quality run is claimed.\nNo recorded-human-audio recognition accuracy, real camera-scene quality,\ncalibrated confidence, table extraction, or automatic-action acceptance is\nestablished by these tests. Deployment owners must run the intended provider,\nmodel and representative retained corpus before making those claims. The\n[behavior matrix](../../docs/test-matrix/3672-ingestion-extraction.md) records the\nrelease commands and authority obligations.\n\nThe versioned on-disk corpus manifest records exact hashes for valid embedded,\nraster and mixed PDFs, two-page TIFF, a synthetic camera-format JPEG, a valid\nPCM WAV recording of a generated tone, email text, corrupt PDF and unsupported\nvideo. The tone is not human speech; the illustrated scene is not a photograph.\nReal local HTTP fixture runs execute Unlimited-OCR's installed SDK and speech\ntransport against deterministic responses/timeouts. They verify adapters, not\nremote models. Unlimited-OCR 0.61.6 rejects valid encoded images smaller than\n100 bytes; ingestion reports `unavailable` without altering them. This owning\nSDK defect is tracked in [happyvertical/ocr#143](https://github.com/happyvertical/ocr/issues/143).\n\nEach capability record explicitly reports `truncation` and `usage` as `unknown`\nor `reported`. Unlimited-OCR's current SDK discards upstream `finish_reason`\nand token usage, so both are `unknown` even for nonempty output. Downstream\nrules must not interpret `status: 'complete'` or `truncated: false` as proof of\nuntruncated OCR: they describe completed input processing and *detected*\ntruncation only. The adapter never bypasses the SDK to recover hidden fields.\nThe missing SDK metadata is tracked in [happyvertical/ocr#144](https://github.com/happyvertical/ocr/issues/144).\nAI vision retains reported truncation when supplied by its SDK. Missing provider\ncost is unknown, not zero; no cost estimate is invented.\n"
|
|
1719
1719
|
},
|
|
1720
1720
|
{
|
|
1721
1721
|
"path": "PROPOSALS.md",
|
|
1722
1722
|
"module": "PROPOSALS",
|
|
1723
|
-
"content": "# Application-aware proposal generation\n\n`@happyvertical/smrt-ingestion/proposals` is server-only. Configure\n`IngestionOptions.proposals` and the existing `execution.handlers` catalog.\nHandlers opt into discovery with `discovery.mediaTypes`, `references`, and an\noptional `candidates` callback. There is one catalog: the same operation or\nordered playbook adapter is discovered, validated, previewed, and later applied\nby the execution service. Generation never approves or applies.\n\nCredential-free review hosts may configure `IngestionOptions.proposalRead` with\n`ProposalReadConfiguration`: public generator/decision identities, version,\nprompt version, limits and thresholds only. It reads completed proposals,\npreserves current authority and snapshot validation, and permits human preview;\nit never accepts a generator or provider client. If a process supplies both\nsettings, their public configuration must match exactly. Preparing or generating\nproposals still requires `proposals` with a real generator.\n\n## Discovery and authority\n\n`listHandlers(itemId)` returns a bounded detached catalog. The owning execution\nservice checks the current principal, captured permissions/handler/operation\nceiling, policy, confidential scope, public registered operation facts, and\nordered playbook definition. Every configured provider must occur in the current\npolicy's `providers` allowlist. Missing grants remove handlers before model input.\nAn authorized catalog larger than the configured bound is rejected; the host must\nnarrow it explicitly instead of relying on silent truncation.\n\n`findCandidates({itemId,handlerId,handlerVersion,query,limit})` returns\n`{items,truncated}`. Its trusted handler callback receives `HandlerContext` with\nthe authorized transaction executor. Query by tenant and confidential scope\n**before** selecting, ranking, or building labels. Use a bounded query (often\n`limit + 1`) and report `hasMore`. The service projects candidate identity, model,\nrevision and label, then checks every target with the owning execution callback.\nThere are no hidden counts or pagination tokens. Truncated discovery forces\n`needs_review`; a person may still preview it explicitly, and automation never\nbecomes eligible.\n\nCompleted generation reload checks process authority, the current attempt, and\nowner/candidate visibility in the same final transaction. Database-backed grant\ncallbacks must use the supplied executor. The owning retention lifecycle encloses\nthat transaction so a denied read cannot roll back an authorized shorter privacy\nceiling; restoration starts only after the outer transaction has rolled back.\n\nCandidate callbacks perform bounded database reads only: no provider I/O, network,\nor domain mutations. Target locks and existing retention enforcement remain\nowned by execution. Hosts configure their database's statement deadlines; an\narbitrary trusted callback is not a sandbox. Each existing-record argument must\nbe a declared top-level `references` field of kind `candidate` with its qualified\nmodel, or `evidence`. Closed JSON argument schemas are required. The host owns\nthat declaration and its target authorization semantics.\n\n## Durable stages\n\n1. Complete extraction through the existing analysis ledger.\n2. Call `prepareGeneration(itemId, extractionAttemptId)`. It reads the current\n completed/partial immutable extraction and returns configuration with\n `stage: 'interpret'`, pinned source attempt/revision/input/output/evidence\n digests, prompt/configuration/catalog/provider versions, limits and thresholds.\n3. Pass that configuration to `analyze(itemId, configuration, requestKey)` and\n claim its new revision with `claimAnalysis`.\n4. The host's existing job callback routes on the frozen `configuration.stage`:\n extraction invokes `extractAnalysis`; interpretation invokes\n `generateProposals(lease)`.\n5. Reload the current completed generation using `getCompletedAnalysis(itemId)`,\n or pass an explicit attempt ID to additionally reject stale client state.\n Queued/running revisions never return an older completed attempt.\n\n`analyze` refuses an interpretation configuration whose pinned source is not\nthe item's latest extraction, checked under the item lock before anything is\nsuperseded (`GenerationSourceStaleError`, nothing appended). A preparation\nsuperseded by a later extraction therefore fails at append time rather than\nafter a revision was created.\n\nA generation revision does not rewrite terminal extraction. Reprocessing starts\nwith a new extraction revision, followed by interpretation, while the host keeps\nthe same business intention keys. An interrupted still-current generation lease\ncan be retried; terminal generation output remains immutable. `getGenerationInput`\nreads historical extraction only through the current generation lease and its\nfrozen source pin. It verifies same-item scope, immutable hashes, durable evidence,\nand current process permission before returning detached data. The source must be\nthe immediately preceding revision, so an intervening reprocess invalidates a\nprepared generation. Completed generation reads additionally recheck current\ncatalog and target visibility before disclosing persisted candidate labels.\nExpired, cancelled, revoked, retried or superseded workers cannot read or publish late output. The\ncurrent lease and each offered handler/candidate are rechecked immediately before\neach outbound generative/decision boundary and before publication.\n\n### Inline interpretation\n\nReceipts created with `dispatch: 'inline'` (text/structured parts only) run the\nsame stages in-process through `interpretInline(itemId, { requestId, extraction\n})`: an immutable extraction revision claimed under a fenced lease and extracted\nwith the built-in UTF-8 extractor, then `prepareGeneration` and a fenced\ninterpretation revision generated by `generateProposals`. The analysis lease,\ncatalog digest and live catalog/candidate checks, source pin, provenance and\n`StageFailure` categories are identical to the job path; no dispatch intent is\never deliverable and nothing is enqueued. A retry with the same `requestId`\nreplays the recorded revisions rather than re-preparing against a superseded\nsource, also under concurrency. The interpretation append rechecks, under the\nitem lock, that its pinned extraction is still the latest revision and refuses\na superseded pin: first through the general latest-extraction check that\nevery interpretation append runs (`GenerationSourceStaleError`), then by the\ninline check that the pinned attempt is still current (`Generation source changed`). Generated suggestions still require explicit preview and a human\ndecision, either through the reviewer surface or the submitter-scoped surface\ndescribed in [REVIEW.md](REVIEW.md).\n\n## Providers and validation\n\n`createSDKProposalGenerator(client, identity, {maxTokens,timeoutMs})` uses an\nexisting AI SDK `chat` client. It sends a fixed system instruction and separate\nJSON evidence/catalog data, requests JSON, supplies cancellation and bounds, uses\nno tools or continuation, and rejects known truncation or tool calls,\nunexpected models, malformed JSON and oversized output. Configure SDK clients\nwithout automatic retry that would bypass application boundary checks. The\nadapter's public identity is exactly provider/model/version; credentials and raw\nprovider errors are never provenance.\n\nThe fixed system instruction (`proposalInstructions`, extended per item by\n`proposalInstructionsFor` with the handler argument contract and split\neligibility) is generic and value-free. It treats evidence as untrusted data,\nnever instructions, and limits suggestions to offered handlers and candidates.\nIt asks the model to fill every argument readable from the evidence\n(identifiers, numbers, dates, quantities, amounts and currency) in the form its\nschema requires, never inventing a value the evidence does not show; a value\nthat cannot be expressed in that form is treated as absent. Each value must be\nthe one whose label or context matches the field's name and description; when\nseveral similar values appear, a field whose named value is missing is treated\nas absent rather than given a substitute. A candidate reference is chosen only\nfrom that handler's listed candidates, and an evidence reference copies the\nsupplied `evidenceId`. `missingFields` lists exactly the required fields left\nout of `args`, and a required field is left out only when its value is genuinely\nabsent or no offered candidate matches. On required-only schema refusals, the\nvalidator computes the absent required set and corrects a mismatched model\ndeclaration; the instruction guides the model without making its declaration\nauthoritative. Absent optional fields stay out\nof both `args` and `missingFields`. The model prefers `no_action` when no\noffered handler's description fits the document's role, and `unknown` when the\nevidence cannot be interpreted (#4290). Domain routing, such as which received\ndocuments an application ignores, belongs in host handler descriptions or\nreviewer guidance, not in this text. The text is not persisted. It is not part\nof the frozen interpretation configuration, the input, catalog or output\ndigests, or the stored generation output, so a package release that changes it\nleaves stored attempts readable and previewable unchanged. New attempts send the\nnew text, but their digests do not record it; a host that needs provenance to\ntell the two apart bumps its own `promptVersion`, which, like any configuration\nchange, makes earlier attempts read as stale (`GenerationSnapshotStaleError`).\n\nA trusted custom `ProposalGenerator` must likewise honor cancellation, bound its\nresponse, and explicitly declare validated `complete` or `unknown` completion.\nThe SDK currently normalizes missing/unknown finish reasons to `stop`\n([owning SDK follow-up](https://github.com/happyvertical/sdk/issues/1381)), so its\nadapter conservatively declares `unknown`, persisted as\n`generation_completion_unknown`. Otherwise valid suggestions remain available\nfor human preview; automatic eligibility always remains false. The service\ndeadline aborts requests and prevents late publication; it does not claim to terminate computation at a remote\nprovider or isolate native allocations. Extractor process limits remain separate.\n\nWhen the pinned extraction carries an authenticated reviewer instruction\n(REVIEW.md), `prepareGeneration` copies it into the interpretation configuration\nand `generateProposals` verifies that copy against the extraction record and its\nown digest before provider disclosure (`integrity` otherwise). The prompt then\ncarries it in its own **trusted reviewer guidance** section after the fixed\nsystem instruction and handler contract: the guidance is named as authenticated\nhuman input, limited to the offered catalog, and the evidence remains untrusted\ndata. `GenerativeProposalInput.reviewerInstruction` exposes `{id, text}` to custom\ngenerators; `provenance.reviewerInstruction` records `{id, digest}`. The\ninstruction never changes `offered`, `catalogDigest`, argument schemas,\npermissions or `automaticActionEligible`; a reply that follows guidance outside\nthe catalog fails validation like any other hostile output. **Budget cost:** the instruction counts once against the input budget\n(`maxInputBytes`, each offered handler's `maxBytes` and the live policy\nceiling), as its JSON-escaped text inside the prompt's guidance section — up\nto 4,000 characters plus escaping and the fixed guidance sentence. The\n`reviewerInstruction` field duplicated for custom generators is not counted\nagain. The decision stage also carries it once: its request state holds the\nevidence-side input with the un-guided base instructions under `evidence`, and\nthe guidance only under a separate `reviewerGuidance` key, never under\n`evidence`; the decision budget measures that serialized request as sent. Size `maxInputBytes` with that headroom. Learned examples are\nstill retrieved for an instructed generation; only a logical split correction\nsuppresses them. Every instruction costs a fresh extraction revision before the\nnew interpretation: the predecessor-pin contract above (source = immediately\npreceding revision, current-revision reads) is deliberately left intact rather\nthan reused for a same-source second interpretation, so OCR/speech hosts budget\none extraction per instruction, as for split corrections.\n\nModel output can contain only offered handler versions, schema-valid arguments,\nretained evidence locations and offered alternative handler/candidate keys.\nCandidate IDs must occur in the offered set, and evidence IDs in retained source\nresults. Unknown enums, invented IDs, extra authority/tool/approval fields and\nmalformed structures fail closed (an invented candidate target alone is dropped\nfor review instead, see below). Missing required fields are retained as\n`missingFields`, with `needs_review`; values are never invented to satisfy a\nschema. Observed page/time/source granularity is preserved. Logical scan splits\nuse `proposeDocumentSplits`; originals and hashes remain intact.\n\nWhen a suggestion's arguments fail the handler schema **only** on `required`\n(#4284), the suggestion is kept rather than rejecting the attempt: its\narguments stay exactly as generated and `missingFields` names every missing\nrequired argument. The schema, not the model, decides what is missing. A\ndeclaration that matches the computed set (in any order) is kept exactly as the\nmodel wrote it, so an already valid reply is unchanged byte for byte and replay\nstays deterministic. A declaration that differs (unlisted misses, or listed\nfields that are present or optional) is replaced by the sorted computed set and\nthe suggestion is `needs_review` even when nothing is left missing;\n`provenance.missingFieldsCorrection` then records `{suggestions, added,\nremoved}` counts only, and is absent otherwise and dropped whenever the\nsuggestions are discarded. A miss at the\nargument root is the bare property name; a miss inside a present nested object\nor array item is an RFC 6901 JSON Pointer relative to the arguments, such as\n`/vendor/name` or `/lines/0/sku`. An entry starting with `/` is therefore a\npointer, so a handler should not declare a root property whose name itself\nstarts with `/`. Names come from the handler schema's own `required` lists,\nnever from argument values or model-chosen keys; `required` inside `allOf` or\ninside object-form `dependencies` (`{a: {required: ['b']}}`) counts like any\nother. The schema walk does not follow `$ref`: a miss directly at a property\nwhose schema is a `$ref` is kept, but a miss deeper inside the referenced\ndefinition cannot be named from the schema and rejects (fail-safe). The attempt still rejects as before when any other\nkeyword fails beside or instead of `required`: type, enum, pattern, bounds,\n`additionalProperties`, an `anyOf`/`oneOf` branch, an `if`/`then`/`else` branch\n(Ajv adds an `if` error), `not`, or array-form `dependencies` (its own keyword,\nalthough it names the missing property). It also rejects when a miss lies under\na key the schema does not declare, or when more than 30 fields are missing.\nHandler schemas compile in Ajv strict mode, so draft-2019 keywords such as\n`dependentRequired` are refused at compile time. Such a suggestion is ordinary\n`needs_review` output: the decision gate can only withhold readiness, never\ngrant it, `automaticActionEligible` stays false, and generated preview of\nincomplete arguments fails the handler schema (see Explicit preview below).\n\nA generated split whose groups fail that check is dropped, not the whole reply\n(#4288): the suggestions and any other splits are validated as before, the\ndropped split is never published or applied, and `provenance.splitsDropped`\nrecords `{count, checks: ['split_groups']}`, never pages or evidence ids. Any\nother split error still fails the attempt. If every split is dropped, the reply\nhas no split; a reviewer can still split through `reviseLogicalSplit`, and a\nrecorded split correction the reply no longer matches ends as\n`human_split_not_respected`. A split for unknown or repeated evidence is still\nrejected, even when the earlier split on that evidence was dropped. Like\n`duplicatesRemoved`, `splitsDropped` is kept only on a published, validated\nreply. Stored output is never re-validated, so earlier attempts and their\ndigests replay unchanged.\n\nAn invented target — a value in an offered handler's candidate reference field\nthat is not among the offered candidates for that field's model — no longer\nrejects the attempt (#4289). The validator drops the key from the arguments\n(no placeholder) and revalidates what remains through the required-only path\nabove: a dropped required field becomes a computed `missingFields` entry, a\ndropped optional field is simply absent, and either way the suggestion is\n`needs_review` for the reviewer to choose an offered target.\n`provenance.unofferedTargetsDropped` records `{suggestions, fields}` counts\nonly, never IDs, labels or field names; it is absent when nothing was dropped\nand removed whenever the suggestions are discarded. Every candidate field that\nstays in the arguments has been checked against the offered set, so no\nunoffered value survives as a target. The attempt still rejects as before for\nan unoffered handler or alternative, unknown evidence (argument or reference),\na non-string target, a target field the handler schema does not declare in\n`properties`, any other argument error, or a drop that exposes a refusal other\nthan `required`.\n\nThe exact dropped value is also searched for in the kept suggestions and splits\n(JSON-escaped, keys included); an exact echo, such as the ID repeated in an\nexplanation or another argument, rejects the attempt. This guard fails closed\non short or common values: a dropped `\"1\"` or `\"a\"` almost always occurs\nsomewhere else in the output, so such a reply rejects rather than being kept.\nIt is an exact-match check, not a general leak filter: a case variant, a\nreformatted copy or a fragment of the ID in free text (an explanation or a\ntext argument) is not detected and may reach the reviewer as ordinary model\nprose. Free text is never a target and never authority; only the checked\ncandidate fields are.\n\nA rejected reply ends the attempt as `provider_error` with the `malformed_output`\nwarning and a bounded, value-free `provenance.failure` `{category, reason}` (#4207).\nThe reason lists schema-owned paths, keywords and schema constants, for example\n`/outcome enum (allowedValues=proposals|unknown|...)` and\n`/suggestions/0 required (missingProperty=evidence)`, or the fixed internal check\nand its path, such as `Unoffered handler: /suggestions/0`. Path segments are\nkept only when they are keys declared under the schema's `properties` or\nindexes into a value that actually is an array in the rejected reply; any other\nsegment, numeric or not (for example a key under an open\n`additionalProperties` argument sub-schema, or a numeric key of an object),\nbecomes `?`, and an extra property's name is never echoed.\nIt never contains document text, argument values, evidence content or\nmodel-chosen keys, is cut at 1000 characters,\nand is dropped before the output-limit fallback. Hosts read it from the\ncompleted/partial analysis at `analysis.result.output.proposals.provenance.failure`.\nThe SDK adapter constrains replies with a `json_schema` response format built\nfrom the validator's schema and the fixed instructions describe the shape; a\ncustom `ProposalGenerator` receives no schema, so its raw reply meets the\nvalidator directly and the same reason is recorded.\nThe provider-facing schema is made portable (`portableResponseSchema`, #4260):\nkeywords that common OpenAI-compatible structured-output backends reject are\nremoved at schema positions, including inside handler argument schemas\n(`uniqueItems`, `contains`, `multipleOf`, `format`, `patternProperties`,\n`propertyNames`, `min`/`maxProperties`, `not`, `if`/`then`/`else`,\n`dependent*`, `unevaluated*`, and the `default`/`examples` annotations; the\nfull list and reasons are in `src/proposal-sdk.ts`). With `uniqueItems`, for\nexample, vLLM's xgrammar feature check flags the schema, its auto mode routes\nit to llguidance, and llguidance answers\n`400 Grammar error: Unimplemented keys: [\"uniqueItems\"]`. This only loosens the\ngrammar: the validator still enforces the constraints, including unique\n`alternatives` and `missingFields`, and the fixed instructions ask for distinct\nentries. The exception is `format`, which is advisory: the validator runs Ajv\nwith `validateFormats: false`, so `format` is enforced nowhere. Because a model\ncan still repeat an entry, fresh generator output is normalized first (#4286):\nwithin each suggestion, repeated `alternatives` and `missingFields` entries\n(equal by canonical JSON) are dropped, keeping the first. Nothing else is\nrewritten, and `uniqueItems` still applies to the result. The count, never the\nvalues, is recorded as `provenance.duplicatesRemoved`, present only when\nnon-zero and only on a published, validated reply. The published output, and so\nits digest, is the normalized form. Stored attempts are read and replayed as\npersisted; they are never renormalized. When\n`patternProperties` is removed, the same object's `additionalProperties` is\nremoved too, so the grammar does not shrink to `{}`. The `contentSchema` annotation is omitted as well, so nested unsupported\nconstraints cannot leak through an unvisited schema position. A backend may\nrecursively inspect typed schema-like objects even inside `enum` or `const`\ndata. When such data contains an unsupported keyword, the whole containing\n`enum`/`const` constraint is omitted conservatively; literal data is never\nrewritten. Harmless property names and ordinary enum/const data stay intact.\nThe original validator remains authoritative for omitted literal constraints.\nThere is no automatic `json_object` fallback.\n\nInvariant: the provider copy only ever accepts a superset of what the original\naccepts. Each removed keyword is a conjunct, so removing it only widens. The two\nplaces where removal would narrow are rewritten:\n- every `oneOf` becomes `anyOf` (or joins an existing `anyOf` through `allOf`),\n because loosened `oneOf` branches could both match and reject a value the\n original accepted;\n- an object that loses `patternProperties` also loses `additionalProperties`.\n\nProvider-only `$ref`, `$dynamicRef`, and `$recursiveRef` constraints are also\nremoved. Rewriting or deleting a subschema can invalidate pointer or anchor\ntargets, including targets inside nested `$id` resources. Dropping references\nconservatively widens the grammar without resolving untrusted schema resources;\nproperty names and enum/const data named `$ref` remain unchanged. Referenced\nconstraints, recursion, and dynamic scope remain enforced by the original\nvalidator, so provider guidance for reference-based arguments is less precise.\n\nThe validator still checks the original, including `oneOf` exclusivity. A\nproperty-style regression checks original-valid ⇒ portable-valid across the\nremoved keywords. Handler argument schemas may still carry `allOf` through\nunchanged; its support across backends is unverified, so check such a handler\nagainst the deployed backend.\n\nA generator call that throws ends the attempt as `provider_error` with the\n`unavailable` warning and `provenance.failure` `{category: 'unavailable',\nreason}`. The reason is value-free by construction: a provider's own text can\nquote the prompt or document, so it is never copied. The reason is built only\nfrom a fixed phrase and:\n\n- for an SDK `AIError` only, the HTTP status (from a structured field, or from\n the exact `<status> ...` / `TypeSafe request failed (<status>): ...` shapes\n the SDK produces), the SDK error code (from the closed list of codes the SDK\n raises), for a schema rejection the quoted tokens that are JSON Schema\n keywords, and the OpenAI SDK's exact fixed transport messages\n (`Connection error.`, `Request timed out.`, `Request was aborted.`,\n `(no status code or body)`), which its `mapError` keeps without a cause;\n- for the SDK adapter's own refusal of a reply it did receive, a fixed problem:\n finish reason other than `stop` (named from the closed list `stop`, `length`,\n `tool_calls`, `content_filter`, otherwise `other`), truncation, tool calls,\n an unexpected response model, no text content, an empty reply, a reply over\n the output limit, or a reply that is not valid JSON (#4285);\n- for any other error (#4285), the code-defined constructor name (an\n identifier ending in `Error` or `Exception`; never the settable `name`),\n an `AbortError`/`TimeoutError` name, a network `code` from a closed list\n (`ECONNREFUSED`, `ECONNRESET`, `ETIMEDOUT`, `ENOTFOUND`, `EAI_AGAIN`,\n `UND_ERR_*`, TLS certificate codes, ...) read from the error, up to three\n `cause` levels and an `AggregateError`'s entries, and a structured numeric\n status. A timeout or abort is named as one, except that a structured HTTP\n status always wins over an abort name or network timeout code on a non-SDK\n error, whether on the error itself or in its cause chain. An SDK error's\n abort is read only from its code or exact transport message.\n\nFor example: `provider rejected the response schema (HTTP 400, code API_ERROR);\nunsupported response-schema keywords: uniqueItems`,\n`provider response incomplete (finish reason length)`,\n`provider call failed (class TypeError, network ECONNREFUSED)`,\n`provider call aborted or timed out (class DOMException, name TimeoutError)`, or\n`provider call failed (class Error)`. It is cut at 500 characters.\n\n**Why some failures were a bare `provider call failed` (#4285).** The SDK\nadapter's own response checks threw plain `Error`s (finish reason not `stop`,\ne.g. `length` when the reply reached `maxTokens`; truncation; tool calls; an\nunexpected response model; non-text or oversized content) and `JSON.parse`\nthrew a `SyntaxError` for an empty or non-JSON reply. The reason deliberately\nreads nothing from a non-SDK error, so all of these collapsed into the fixed\nphrase. Transport failures through the OpenAI SDK already carried\n`code API_ERROR`. The adapter now raises `ProposalResponseError` with a fixed\nproblem, and other non-SDK errors contribute the transport facts above. The\ncategory is unchanged (`unavailable`).\n\n### Failed-attempt capture (opt-in, #4285)\n\nThe value-free reason cannot show what the model actually sent. A host that\nneeds that for diagnosis can opt in to keeping it:\n\n```ts\nproposals: {\n // ...\n failureCapture: {\n enabled: true, // required; absent or false keeps capture off\n maxBytes: 16384, // default 16384, at most 65536 (UTF-8 bytes, after redaction)\n redact: ({ text, source }) => hostRedaction(text), // required to retain text\n },\n},\n```\n\n`ProposalConfiguration.failureCapture` is **off by default**. When enabled with\na host `redact` hook, a failed interpretation attempt (`provider_error`) keeps\none of:\n\n- `raw_response`: the reply text the SDK adapter refused (for example invalid\n JSON or a `length` finish), or\n- `generated_output`: the generator's parsed output, as JSON, that failed\n validation, the declared-completion check or the output limit.\n\nErrors without model output (transport, timeouts, authority, decision\nfailures) capture nothing. Successful attempts never store a capture.\n\nWithout a `redact` hook, only `status: 'redaction_failed'` metadata is stored,\nwith `redacted: false` and no text; the candidate text is not materialized.\nThere is no built-in sanitizer. Hosts own the hook's semantic redaction policy;\nthe service cannot verify that the returned text removes every document secret.\n\nThe text, cut to the larger of the generation `maxOutputBytes` and\n`maxBytes`, goes through the host `redact` hook, and the result is cut to\n`maxBytes` without splitting a character (`truncated: true` when either cut\napplied). NUL and unpaired surrogates are stored as U+FFFD so PostgreSQL JSON accepts the record. When\nthe hook throws, returns a non-string or exceeds its asynchronous wait budget,\nonly `status: 'redaction_failed'` is stored. The budget is the generation\n`timeoutMs`, cut to half of the analysis lease still left when the hook starts\n(no time left: the hook is not called). The hook runs after the authority\nrecheck, reserving the rest of the lease for the second recheck and publication.\nThis timer cannot preempt synchronous work or cancel the hook. Hosts must use\nbounded, nonblocking redactors. Missing or failed redaction does not replace the\nattempt's real failure or value-free reason; hook errors are discarded.\n\n**Where it lives.** In the attempt row's `data` JSON, as `failureCapture`\nbeside the result fields, never inside `result`: it needs no migration, is not\npart of `output_digest` or any configuration digest, never appears in\n`getCompletedAnalysis` or any other snapshot, and is not public read\nconfiguration (`proposalReadConfiguration` omits it, so read-only hosts still\nmatch). Proposal digests, replay and frozen generation configuration are\nunchanged by enabling it.\n\n**Reading it back.** Only\n`IngestionService.getFailedAttemptCapture(itemId, attemptId?)` returns it\n(`FailedAttemptCapture` from `/dto`, or `null` when nothing was stored). The\nattempt defaults to the item's current analysis attempt. It requires the\nexecution catalog and the current **reviewer** authority for that item (the\nsame gate as `getItemDisposition`) inside the caller's tenant and confidential\nscope; every denial, expiry, cancellation or foreign item fails closed before\nthe row is read. It is never part of a list DTO, inbox row, review page,\nlog line, checkpoint name, telemetry or error message.\nPublication and reads also reject a persisted `captured` record with\n`redacted: false`; capture text must be marked as processed by a configured\nhost hook. Persisted caps must remain within 1–65536 bytes, and captured text\nmust fit its declared UTF-8 byte cap; malformed records fail closed.\n\n**Retention and deletion.** It follows the item. There is no separate delete\nAPI: `expire`, `sweepRetention` and the `repairDeletions` retry of an\ninterrupted propagation all empty attempt `data`, which removes the capture\nwith the rest of the payload; a revoked item is unreadable before that.\n\n`createSDKProposalDecisionClient(client)` adapts an existing SDK client’s optional\ncapability without changing its errors or protocol. Optional `decision` uses public core `executeDecision` and the existing SDK\npredicate, choice, score and batch contracts. Supported-effect predicates,\nhandler classification, candidate entity matching, and action ambiguity/risk\nare distinct questions. Their validated probabilities and provenance are stored\nseparately from generative provenance and unknown OCR certainty. The complete\nserialized decision request, including suggestions and questions, must fit the\nminimum configured/current policy byte ceiling before capability probing and\nagain before deciding. A policy change between these boundaries fails closed.\nActually incomplete extraction always requires review. Unknown provider\ncompletion metadata is preserved as `source_completion_unknown`; it does not\nblock otherwise schema-valid **human** preview or imply completeness. Automatic\naction eligibility remains false. An unconfigured decision path\nis recorded explicitly. Configured errors produce a durable safe failure outcome;\nthey never silently switch to a generative decision fallback.\n\n### Decision readiness gate (#4209)\n\nFor every suggestion `i` the request asks `supported_i` (predicate),\n`route_i` (choice over the offered `handlerId@version` keys plus `none`),\n`risk_i` (ordered score over `clear`, `uncertain`, `ambiguous`) and one\n`entity_i_<field>` choice per candidate-reference argument. The validated\nanswers are always persisted under `provenance.decision.answers`. With the\ndefault `decisionReadiness: 'gate'` they are read as follows, and any failing\ncheck sets the suggestion to `needs_review` (a tie also sets the outcome to\n`ambiguous`):\n\n- `supported.probability >= minimumDecisionProbability` (default `0.8`).\n- `route.choice` equals the suggestion's own `handlerId@handlerVersion`,\n `route.confidence >= minimumDecisionProbability`, and the gap between the two\n largest route probabilities is greater than `tieMargin` (default `0.1`).\n- `risk.score < 1`: only the `clear` level passes; `uncertain` and `ambiguous`\n require review.\n- Each entity match chooses the suggested candidate's key with confidence at or\n above the threshold and a gap above `tieMargin`.\n\nThese values are provider outputs read as if they were calibrated\nprobabilities; nothing in this package calibrates them for this use. The\nteamworks-os measurement in #4209 (self-hosted Laya `typed-decisions`) found no\nseparation between right and wrong suggestions: a correctly read vendor invoice\nscored `supported` 0.37, garbage input 0.45–0.50, a wrongly proposed purchase\norder 0.51, route confidence 0.003–0.15 and `risk` ≥ 0.94, so the gate sent\nevery suggestion to review. Until a labelled sample shows separation, treat the\nanswers as diagnostics and configure:\n\n- `decisionMaxLen`: positive integer forwarded unchanged as the per-request\n `maxLen` of the decision client (the SDK Laya provider's token window; the\n checkpoint default is 1024 and the serialized evidence plus suggestions is\n otherwise truncated). Other clients ignore it.\n- `decisionReadiness: 'record'`: the decision still runs, is bounded and\n authorized exactly as before and its answers, usage, `readiness` and `maxLen`\n are recorded, but the gate never changes `outcome` or `disposition`; readiness\n comes from the validator alone (`missingFields`, outcome, source completeness).\n A client error or timeout is recorded as the `decision_unavailable`\n warning. A reply that comes back and then fails the core `executeDecision`\n identity or answer-shape check is recorded as `decision_malformed` with the\n reply's usage; this is the path for injected `DecisionClient`s. SDK clients,\n including the Laya provider behind `createSDKProposalDecisionClient`,\n validate the reply's shape inside `client.decide` and throw, so a malformed\n SDK reply is recorded as `decision_unavailable` with no usage. Every case\n records the `provenance.decision` identity. The generated suggestions stay\n as they were. The serialized request exceeding the byte budget is a\n configuration failure, not a provider answer: it ends the attempt as `limit`\n in both modes, and in `gate` mode every failure above still ends the attempt\n as `provider_error`. Lease, catalog, policy and provider-allowlist revocation\n fail closed in both modes.\n\nSuccessful output also records `provenance.decision.readiness` (`'gate'` or\n`'record'`) and `maxLen` when set; configuration digests are unchanged, but\npersisted output is therefore not byte-identical to earlier releases.\n\nBoth settings are public configuration: they are part of\n`ProposalReadConfiguration`, the frozen `GenerationStageConfiguration.proposals`\n(present only when set, so existing digests are unchanged) and the completed\nsnapshot authority check. Invalid values fail at proposal service construction.\nNeither mode affects automation: `automaticActionEligible` stays `false`, and\n`authorizeAutomatic` reads only the host's `evaluateAutomatic` callback and\npolicy, never these answers.\n\nOutput records zero, one or multiple suggestions, alternatives, missing fields,\nsource links, proposed splits, versions, allowlisted usage, warnings and explicit\n`unknown`, `ambiguous`, `no_action`, `needs_review` or `provider_error` outcomes.\n`automaticActionEligible` is always false. Provider input/output and the complete\nserialized persisted envelope are bounded by configuration, live policy and the\nreceipt ceiling. Oversized output becomes a bounded review/limit result; when\nno safe envelope fits, the owning service records fixed `failAnalysis` metadata\noutside the provider payload budget without retaining provider output.\n\n## Explicit preview and stable intentions\n\nThe host chooses persisted suggestion indexes and calls:\n\n```ts\nawait service.previewGeneratedProposals({\n itemId,\n attemptId: generationAttemptId,\n selections: [{\n index: 0,\n intentionKey: 'document:meeting-2026-10-09',\n expectedRevision: 0,\n requestId: 'review-request-1',\n }],\n});\n```\n\n`intentionKey` is the host's stable business-intention identity across generation\nrevisions. Never derive a fresh key from model output, suggestion order or a retry.\nSelections must reference current persisted validated `ready_for_review` or\n`needs_review` output (#4208); a `provider_error` attempt, an unoffered handler or\na non-interpretation stage is rejected. A `needs_review` suggestion whose\n`missingFields` are still absent fails the handler schema inside the ordinary\npreview (`HandlerArgumentsInvalidError`, `Invalid handler payload`, whose\nvalue-free `issues` name the missing schema fields, for example\n`{ path: '/title', keyword: 'required' }`; see REVIEW.md) and publishes\nnothing; the reviewer supplies\nthe missing values through the explicit human path (`previewProposal` /\n`previewPlan`, as the published review host does for `preview({args})`), and the\nhandler's `validate` and `preview` run again on the completed arguments.\nEach batch requires distinct suggestion indexes and intention keys; duplicate\nindexes are rejected before any operation or plan preview is written.\nThe service rechecks current catalog/schema/target/source provenance, then calls\nthe existing operation or plan preview. Each result still requires the ordinary\nhuman review and execution APIs. Reprocessing creates no new business identity;\nsuccessful-action replay protection stays with execution.\n\n## Evidence and limits\n\nThe test matrix is `docs/test-matrix/3673-ingestion-proposals.md`. SQLite and real\nPostgreSQL suites exercise authority, revisions, abstention, hostile output,\ncompound proposals, split provenance and reviewed domain effects. The upload\nreference composes authenticated multipart delivery of a generated embedded-text\nPDF through the actual packaged PDF child, durable interpretation, and the existing\nordered ContentDocument draft/retained-asset plan. It checks duplicate delivery,\nunauthenticated and foreign-tenant denial, explicit approval of both steps,\nidempotent execution replay, page provenance, and unchanged original bytes.\nThe compound-email case uses a declared messages-owner snapshot fixture.\n\nLocal HTTP fixtures execute the actual AI SDK transport and cancellation contract.\nGenerative responses and the separate injected PDF split boundaries establish\ndeterministic orchestration, not model accuracy or OCR quality. No held-out routing\nevaluation or automatic approval is claimed. Missing/unknown AI completion remains\nexplicit under [SDK #1381](https://github.com/happyvertical/sdk/issues/1381).\n\nProposal limits are checked at `IngestionService` construction: positive safe\nintegers, at most 20 handlers/candidates/suggestions and 2147483647 ms timeout.\nInterpretation output uses the exported `GenerationAnalysisOutput` wrapper at\n`analysis.result.output.proposals`; the published review host unwraps it.\nAn explicit feedback `retrieve` denial omits optional examples and feedback\nprovenance and continues generation. Item/execution denials, unexpected failures,\nand revocation after examples were selected still fail closed before disclosure.\n"
|
|
1723
|
+
"content": "# Application-aware proposal generation\n\n`@happyvertical/smrt-ingestion/proposals` is server-only. Configure\n`IngestionOptions.proposals` and the existing `execution.handlers` catalog.\nHandlers opt into discovery with `discovery.mediaTypes`, `references`, and an\noptional `candidates` callback. There is one catalog: the same operation or\nordered playbook adapter is discovered, validated, previewed, and later applied\nby the execution service. Generation never approves or applies.\n\nCredential-free review hosts may configure `IngestionOptions.proposalRead` with\n`ProposalReadConfiguration`: public generator/decision identities, version,\nprompt version, limits and thresholds only. It reads completed proposals,\npreserves current authority and snapshot validation, and permits human preview;\nit never accepts a generator or provider client. If a process supplies both\nsettings, their public configuration must match exactly. Preparing or generating\nproposals still requires `proposals` with a real generator.\n\n## Discovery and authority\n\n`listHandlers(itemId)` returns a bounded detached catalog. The owning execution\nservice checks the current principal, captured permissions/handler/operation\nceiling, policy, confidential scope, public registered operation facts, and\nordered playbook definition. Every configured provider must occur in the current\npolicy's `providers` allowlist. Missing grants remove handlers before model input.\nAn authorized catalog larger than the configured bound is rejected; the host must\nnarrow it explicitly instead of relying on silent truncation.\n\n`findCandidates({itemId,handlerId,handlerVersion,query,limit})` returns\n`{items,truncated}`. Its trusted handler callback receives `HandlerContext` with\nthe authorized transaction executor. Query by tenant and confidential scope\n**before** selecting, ranking, or building labels. Use a bounded query (often\n`limit + 1`) and report `hasMore`. The service projects candidate identity, model,\nrevision and label, then checks every target with the owning execution callback.\nThere are no hidden counts or pagination tokens. Truncated discovery forces\n`needs_review`; a person may still preview it explicitly, and automation never\nbecomes eligible.\n\nCompleted generation reload checks process authority, the current attempt, and\nowner/candidate visibility in the same final transaction. Database-backed grant\ncallbacks must use the supplied executor. The owning retention lifecycle encloses\nthat transaction so a denied read cannot roll back an authorized shorter privacy\nceiling; restoration starts only after the outer transaction has rolled back.\n\nCandidate callbacks perform bounded database reads only: no provider I/O, network,\nor domain mutations. Target locks and existing retention enforcement remain\nowned by execution. Hosts configure their database's statement deadlines; an\narbitrary trusted callback is not a sandbox. Each existing-record argument must\nbe a declared top-level `references` field of kind `candidate` with its qualified\nmodel, or `evidence`. Closed JSON argument schemas are required. The host owns\nthat declaration and its target authorization semantics.\n\n## Durable stages\n\n1. Complete extraction through the existing analysis ledger.\n2. Call `prepareGeneration(itemId, extractionAttemptId)`. It reads the current\n completed/partial immutable extraction and returns configuration with\n `stage: 'interpret'`, pinned source attempt/revision/input/output/evidence\n digests, prompt/configuration/catalog/provider versions, limits and thresholds.\n3. Pass that configuration to `analyze(itemId, configuration, requestKey)` and\n claim its new revision with `claimAnalysis`.\n4. The host's existing job callback routes on the frozen `configuration.stage`:\n extraction invokes `extractAnalysis`; interpretation invokes\n `generateProposals(lease)`.\n5. Reload the current completed generation using `getCompletedAnalysis(itemId)`,\n or pass an explicit attempt ID to additionally reject stale client state.\n Queued/running revisions never return an older completed attempt.\n\n`analyze` refuses an interpretation configuration whose pinned source is not\nthe item's latest extraction, checked under the item lock before anything is\nsuperseded (`GenerationSourceStaleError`, nothing appended). A preparation\nsuperseded by a later extraction therefore fails at append time rather than\nafter a revision was created.\n\nA generation revision does not rewrite terminal extraction. Reprocessing starts\nwith a new extraction revision, followed by interpretation, while the host keeps\nthe same business intention keys. An interrupted still-current generation lease\ncan be retried; terminal generation output remains immutable. `getGenerationInput`\nreads historical extraction only through the current generation lease and its\nfrozen source pin. It verifies same-item scope, immutable hashes, durable evidence,\nand current process permission before returning detached data. The source must be\nthe immediately preceding revision, so an intervening reprocess invalidates a\nprepared generation. Completed generation reads additionally recheck current\ncatalog and target visibility before disclosing persisted candidate labels.\nExpired, cancelled, revoked, retried or superseded workers cannot read or publish late output. The\ncurrent lease and each offered handler/candidate are rechecked immediately before\neach outbound generative/decision boundary and before publication.\n\n### Inline interpretation\n\nReceipts created with `dispatch: 'inline'` (text/structured parts only) run the\nsame stages in-process through `interpretInline(itemId, { requestId, extraction\n})`: an immutable extraction revision claimed under a fenced lease and extracted\nwith the built-in UTF-8 extractor, then `prepareGeneration` and a fenced\ninterpretation revision generated by `generateProposals`. The analysis lease,\ncatalog digest and live catalog/candidate checks, source pin, provenance and\n`StageFailure` categories are identical to the job path; no dispatch intent is\never deliverable and nothing is enqueued. A retry with the same `requestId`\nreplays the recorded revisions rather than re-preparing against a superseded\nsource, also under concurrency. The interpretation append rechecks, under the\nitem lock, that its pinned extraction is still the latest revision and refuses\na superseded pin: first through the general latest-extraction check that\nevery interpretation append runs (`GenerationSourceStaleError`), then by the\ninline check that the pinned attempt is still current (`Generation source changed`). Generated suggestions still require explicit preview and a human\ndecision, either through the reviewer surface or the submitter-scoped surface\ndescribed in [REVIEW.md](REVIEW.md).\n\n## Providers and validation\n\n`createSDKProposalGenerator(client, identity, {maxTokens,timeoutMs})` uses an\nexisting AI SDK `chat` client. It sends a fixed system instruction and separate\nJSON evidence/catalog data, requests JSON, supplies cancellation and bounds, uses\nno tools or continuation, and rejects known truncation or tool calls,\nunexpected models, malformed JSON and oversized output. Configure SDK clients\nwithout automatic retry that would bypass application boundary checks. The\nadapter's public identity is exactly provider/model/version; credentials and raw\nprovider errors are never provenance.\n\nThe fixed system instruction (`proposalInstructions`, extended per item by\n`proposalInstructionsFor` with the handler argument contract and split\neligibility) is generic and value-free. It treats evidence as untrusted data,\nnever instructions, and limits suggestions to offered handlers and candidates.\nIt asks the model to fill every argument readable from the evidence\n(identifiers, numbers, dates, quantities, amounts and currency) in the form its\nschema requires, never inventing a value the evidence does not show; a value\nthat cannot be expressed in that form is treated as absent. Each value must be\nthe one whose label or context matches the field's name and description; when\nseveral similar values appear, a field whose named value is missing is treated\nas absent rather than given a substitute. A candidate reference is chosen only\nfrom that handler's listed candidates, and an evidence reference copies the\nsupplied `evidenceId`. `missingFields` lists exactly the required fields left\nout of `args`, and a required field is left out only when its value is genuinely\nabsent or no offered candidate matches. On required-only schema refusals, the\nvalidator computes the absent required set and corrects a mismatched model\ndeclaration; the instruction guides the model without making its declaration\nauthoritative. Absent optional fields stay out\nof both `args` and `missingFields`. The model prefers `no_action` when no\noffered handler's description fits the document's role, and `unknown` when the\nevidence cannot be interpreted (#4290). Domain routing, such as which received\ndocuments an application ignores, belongs in host handler descriptions or\nreviewer guidance, not in this text. The text is not persisted. It is not part\nof the frozen interpretation configuration, the input, catalog or output\ndigests, or the stored generation output, so a package release that changes it\nleaves stored attempts readable and previewable unchanged. New attempts send the\nnew text, but their digests do not record it; a host that needs provenance to\ntell the two apart bumps its own `promptVersion`, which, like any configuration\nchange, makes earlier attempts read as stale (`GenerationSnapshotStaleError`).\n\nEach suggestion's `explanation` is one or two plain sentences stating what the\ndocument is and why the handler fits, with no deliberation, self-correction or\nrestating of the rules, and is bounded at 300 code points (#4331,\n`PROPOSAL_EXPLANATION_LIMIT`). Two such sentences run about 150-250\ncharacters; the bound keeps a verbose model from spending its output budget\n(and hitting the `length` finish reason) on prose instead of arguments. A\nreply cut at the token limit is still refused (`finish_reason`) and partial\nJSON is never salvaged; the grammar bound and the instruction are what keep\nreplies under the limit. The provider schema and the validator carry the same `maxLength`, so the provider\ncopy still accepts a superset of the validator (#4261), and a grammar backend\nenforces the bound while decoding. In the provider schema `explanation` is the\nlast suggestion property, after `handlerId`, `handlerVersion`, `args`,\n`evidence`, `alternatives` and `missingFields`, and the top-level keys are\n`outcome`, `suggestions`, `splits` in that order; `required` lists the same\norder. That order predates #4331 and is now pinned by a test, so explanation\nprose cannot precede the arguments. xgrammar emits object properties in schema `properties` order unless\n`any_order` is set (its default is `false`, and vLLM does not set it), and\nllguidance fixes property order to the `properties` map, then `required`. A provider\nthat ignores the schema can still return a longer explanation: fresh output is\nnormalized after the list deduplication above and before validation, cutting\nit to 299 code points plus `…` on a code-point boundary, so a long explanation\nnever fails validation (the raw output-size and SDK `output_limit` checks\nstill run first). The value-free count is recorded as\n`provenance.explanationsTruncated`, absent when zero and removed with\n`duplicatesRemoved` whenever the suggestions are discarded. It counts only\nreplies from providers that ignore the schema: on a grammar backend such as\nvLLM the string closes at 300 code points with no marker, and nothing is\ncounted. The cut happens\nbefore the invented-target echo check, so an echo beyond the bound is no\nlonger seen; explanation text is never a target or authority.\n\nReplay: the bound, the property order and the instruction text feed no digest.\nThe response schema is built per request and never persisted; the frozen\ninterpretation configuration holds versions, identities, the catalog digest and\n`limits`, none of which include the explanation bound. Stored attempts are read\nas persisted, never re-validated or re-cut, so an earlier attempt with an\nexplanation of up to 2000 characters still reads, previews and replays with\nits original `output_digest`. New attempts' digests cover the bounded form.\n\nA trusted custom `ProposalGenerator` must likewise honor cancellation, bound its\nresponse, and explicitly declare validated `complete` or `unknown` completion.\nThe SDK currently normalizes missing/unknown finish reasons to `stop`\n([owning SDK follow-up](https://github.com/happyvertical/sdk/issues/1381)), so its\nadapter conservatively declares `unknown`, persisted as\n`generation_completion_unknown`. Otherwise valid suggestions remain available\nfor human preview; automatic eligibility always remains false. The service\ndeadline aborts requests and prevents late publication; it does not claim to terminate computation at a remote\nprovider or isolate native allocations. Extractor process limits remain separate.\n\nWhen the pinned extraction carries an authenticated reviewer instruction\n(REVIEW.md), `prepareGeneration` copies it into the interpretation configuration\nand `generateProposals` verifies that copy against the extraction record and its\nown digest before provider disclosure (`integrity` otherwise). The prompt then\ncarries it in its own **trusted reviewer guidance** section after the fixed\nsystem instruction and handler contract: the guidance is named as authenticated\nhuman input, limited to the offered catalog, and the evidence remains untrusted\ndata. `GenerativeProposalInput.reviewerInstruction` exposes `{id, text}` to custom\ngenerators; `provenance.reviewerInstruction` records `{id, digest}`. The\ninstruction never changes `offered`, `catalogDigest`, argument schemas,\npermissions or `automaticActionEligible`; a reply that follows guidance outside\nthe catalog fails validation like any other hostile output. **Budget cost:** the instruction counts once against the input budget\n(`maxInputBytes`, each offered handler's `maxBytes` and the live policy\nceiling), as its JSON-escaped text inside the prompt's guidance section — up\nto 4,000 characters plus escaping and the fixed guidance sentence. The\n`reviewerInstruction` field duplicated for custom generators is not counted\nagain. The decision stage also carries it once: its request state holds the\nevidence-side input with the un-guided base instructions under `evidence`, and\nthe guidance only under a separate `reviewerGuidance` key, never under\n`evidence`; the decision budget measures that serialized request as sent. Size `maxInputBytes` with that headroom. Learned examples are\nstill retrieved for an instructed generation; only a logical split correction\nsuppresses them. Every instruction costs a fresh extraction revision before the\nnew interpretation: the predecessor-pin contract above (source = immediately\npreceding revision, current-revision reads) is deliberately left intact rather\nthan reused for a same-source second interpretation, so OCR/speech hosts budget\none extraction per instruction, as for split corrections.\n\nModel output can contain only offered handler versions, schema-valid arguments,\nretained evidence locations and offered alternative handler/candidate keys.\nCandidate IDs must occur in the offered set, and evidence IDs in retained source\nresults. Unknown enums, invented IDs, extra authority/tool/approval fields and\nmalformed structures fail closed (an invented candidate target alone is dropped\nfor review instead, see below). Missing required fields are retained as\n`missingFields`, with `needs_review`; values are never invented to satisfy a\nschema. Observed page/time/source granularity is preserved. Logical scan splits\nuse `proposeDocumentSplits`; originals and hashes remain intact.\n\nWhen a suggestion's arguments fail the handler schema **only** on `required`\n(#4284), the suggestion is kept rather than rejecting the attempt: its\narguments stay exactly as generated and `missingFields` names every missing\nrequired argument. The schema, not the model, decides what is missing. A\ndeclaration that matches the computed set (in any order) is kept exactly as the\nmodel wrote it, so an already valid reply is unchanged byte for byte and replay\nstays deterministic. A declaration that differs (unlisted misses, or listed\nfields that are present or optional) is replaced by the sorted computed set and\nthe suggestion is `needs_review` even when nothing is left missing;\n`provenance.missingFieldsCorrection` then records `{suggestions, added,\nremoved}` counts only, and is absent otherwise and dropped whenever the\nsuggestions are discarded. A miss at the\nargument root is the bare property name; a miss inside a present nested object\nor array item is an RFC 6901 JSON Pointer relative to the arguments, such as\n`/vendor/name` or `/lines/0/sku`. An entry starting with `/` is therefore a\npointer, so a handler should not declare a root property whose name itself\nstarts with `/`. Names come from the handler schema's own `required` lists,\nnever from argument values or model-chosen keys; `required` inside `allOf` or\ninside object-form `dependencies` (`{a: {required: ['b']}}`) counts like any\nother. The schema walk does not follow `$ref`: a miss directly at a property\nwhose schema is a `$ref` is kept, but a miss deeper inside the referenced\ndefinition cannot be named from the schema and rejects (fail-safe). The attempt still rejects as before when any other\nkeyword fails beside or instead of `required`: type, enum, pattern, bounds,\n`additionalProperties`, an `anyOf`/`oneOf` branch, an `if`/`then`/`else` branch\n(Ajv adds an `if` error), `not`, or array-form `dependencies` (its own keyword,\nalthough it names the missing property). It also rejects when a miss lies under\na key the schema does not declare, or when more than 30 fields are missing.\nHandler schemas compile in Ajv strict mode, so draft-2019 keywords such as\n`dependentRequired` are refused at compile time. Such a suggestion is ordinary\n`needs_review` output: the decision gate can only withhold readiness, never\ngrant it, `automaticActionEligible` stays false, and generated preview of\nincomplete arguments fails the handler schema (see Explicit preview below).\n\nA generated split whose groups fail that check is dropped, not the whole reply\n(#4288): the suggestions and any other splits are validated as before, the\ndropped split is never published or applied, and `provenance.splitsDropped`\nrecords `{count, checks: ['split_groups']}`, never pages or evidence ids. Any\nother split error still fails the attempt. If every split is dropped, the reply\nhas no split; a reviewer can still split through `reviseLogicalSplit`, and a\nrecorded split correction the reply no longer matches ends as\n`human_split_not_respected`. A split for unknown or repeated evidence is still\nrejected, even when the earlier split on that evidence was dropped. Like\n`duplicatesRemoved`, `splitsDropped` is kept only on a published, validated\nreply. Stored output is never re-validated, so earlier attempts and their\ndigests replay unchanged.\n\nAn invented target — a value in an offered handler's candidate reference field\nthat is not among the offered candidates for that field's model — no longer\nrejects the attempt (#4289). The validator drops the key from the arguments\n(no placeholder) and revalidates what remains through the required-only path\nabove: a dropped required field becomes a computed `missingFields` entry, a\ndropped optional field is simply absent, and either way the suggestion is\n`needs_review` for the reviewer to choose an offered target.\n`provenance.unofferedTargetsDropped` records `{suggestions, fields}` counts\nonly, never IDs, labels or field names; it is absent when nothing was dropped\nand removed whenever the suggestions are discarded. Every candidate field that\nstays in the arguments has been checked against the offered set, so no\nunoffered value survives as a target. The attempt still rejects as before for\nan unoffered handler or alternative, unknown evidence (argument or reference),\na non-string target, a target field the handler schema does not declare in\n`properties`, any other argument error, or a drop that exposes a refusal other\nthan `required`.\n\nThe exact dropped value is also searched for in the kept suggestions and splits\n(JSON-escaped, keys included); an exact echo, such as the ID repeated in an\nexplanation or another argument, rejects the attempt. This guard fails closed\non short or common values: a dropped `\"1\"` or `\"a\"` almost always occurs\nsomewhere else in the output, so such a reply rejects rather than being kept.\nIt is an exact-match check, not a general leak filter: a case variant, a\nreformatted copy or a fragment of the ID in free text (an explanation or a\ntext argument) is not detected and may reach the reviewer as ordinary model\nprose. Free text is never a target and never authority; only the checked\ncandidate fields are.\n\nA rejected reply ends the attempt as `provider_error` with the `malformed_output`\nwarning and a bounded, value-free `provenance.failure` `{category, reason}` (#4207).\nThe reason lists schema-owned paths, keywords and schema constants, for example\n`/outcome enum (allowedValues=proposals|unknown|...)` and\n`/suggestions/0 required (missingProperty=evidence)`, or the fixed internal check\nand its path, such as `Unoffered handler: /suggestions/0`. Path segments are\nkept only when they are keys declared under the schema's `properties` or\nindexes into a value that actually is an array in the rejected reply; any other\nsegment, numeric or not (for example a key under an open\n`additionalProperties` argument sub-schema, or a numeric key of an object),\nbecomes `?`, and an extra property's name is never echoed.\nIt never contains document text, argument values, evidence content or\nmodel-chosen keys, is cut at 1000 characters,\nand is dropped before the output-limit fallback. Hosts read it from the\ncompleted/partial analysis at `analysis.result.output.proposals.provenance.failure`.\nThe SDK adapter constrains replies with a `json_schema` response format built\nfrom the validator's schema and the fixed instructions describe the shape; a\ncustom `ProposalGenerator` receives no schema, so its raw reply meets the\nvalidator directly and the same reason is recorded.\nThe provider-facing schema is made portable (`portableResponseSchema`, #4260):\nkeywords that common OpenAI-compatible structured-output backends reject are\nremoved at schema positions, including inside handler argument schemas\n(`uniqueItems`, `contains`, `multipleOf`, `format`, `patternProperties`,\n`propertyNames`, `min`/`maxProperties`, `not`, `if`/`then`/`else`,\n`dependent*`, `unevaluated*`, and the `default`/`examples` annotations; the\nfull list and reasons are in `src/proposal-sdk.ts`). With `uniqueItems`, for\nexample, vLLM's xgrammar feature check flags the schema, its auto mode routes\nit to llguidance, and llguidance answers\n`400 Grammar error: Unimplemented keys: [\"uniqueItems\"]`. This only loosens the\ngrammar: the validator still enforces the constraints, including unique\n`alternatives` and `missingFields`, and the fixed instructions ask for distinct\nentries. The exception is `format`, which is advisory: the validator runs Ajv\nwith `validateFormats: false`, so `format` is enforced nowhere. Because a model\ncan still repeat an entry, fresh generator output is normalized first (#4286):\nwithin each suggestion, repeated `alternatives` and `missingFields` entries\n(equal by canonical JSON) are dropped, keeping the first. Nothing else is\nrewritten, and `uniqueItems` still applies to the result. The count, never the\nvalues, is recorded as `provenance.duplicatesRemoved`, present only when\nnon-zero and only on a published, validated reply. The published output, and so\nits digest, is the normalized form. Stored attempts are read and replayed as\npersisted; they are never renormalized. When\n`patternProperties` is removed, the same object's `additionalProperties` is\nremoved too, so the grammar does not shrink to `{}`. The `contentSchema` annotation is omitted as well, so nested unsupported\nconstraints cannot leak through an unvisited schema position. A backend may\nrecursively inspect typed schema-like objects even inside `enum` or `const`\ndata. When such data contains an unsupported keyword, the whole containing\n`enum`/`const` constraint is omitted conservatively; literal data is never\nrewritten. Harmless property names and ordinary enum/const data stay intact.\nThe original validator remains authoritative for omitted literal constraints.\nThere is no automatic `json_object` fallback.\n\nInvariant: the provider copy only ever accepts a superset of what the original\naccepts. Each removed keyword is a conjunct, so removing it only widens. The two\nplaces where removal would narrow are rewritten:\n- every `oneOf` becomes `anyOf` (or joins an existing `anyOf` through `allOf`),\n because loosened `oneOf` branches could both match and reject a value the\n original accepted;\n- an object that loses `patternProperties` also loses `additionalProperties`.\n\nProvider-only `$ref`, `$dynamicRef`, and `$recursiveRef` constraints are also\nremoved. Rewriting or deleting a subschema can invalidate pointer or anchor\ntargets, including targets inside nested `$id` resources. Dropping references\nconservatively widens the grammar without resolving untrusted schema resources;\nproperty names and enum/const data named `$ref` remain unchanged. Referenced\nconstraints, recursion, and dynamic scope remain enforced by the original\nvalidator, so provider guidance for reference-based arguments is less precise.\n\nThe validator still checks the original, including `oneOf` exclusivity. A\nproperty-style regression checks original-valid ⇒ portable-valid across the\nremoved keywords. Handler argument schemas may still carry `allOf` through\nunchanged; its support across backends is unverified, so check such a handler\nagainst the deployed backend.\n\nA generator call that throws ends the attempt as `provider_error` with the\n`unavailable` warning and `provenance.failure` `{category: 'unavailable',\nreason}`. The reason is value-free by construction: a provider's own text can\nquote the prompt or document, so it is never copied. The reason is built only\nfrom a fixed phrase and:\n\n- for an SDK `AIError` only, the HTTP status (from a structured field, or from\n the exact `<status> ...` / `TypeSafe request failed (<status>): ...` shapes\n the SDK produces), the SDK error code (from the closed list of codes the SDK\n raises), for a schema rejection the quoted tokens that are JSON Schema\n keywords, and the OpenAI SDK's exact fixed transport messages\n (`Connection error.`, `Request timed out.`, `Request was aborted.`,\n `(no status code or body)`), which its `mapError` keeps without a cause;\n- for the SDK adapter's own refusal of a reply it did receive, a fixed problem:\n finish reason other than `stop` (named from the closed list `stop`, `length`,\n `tool_calls`, `content_filter`, otherwise `other`), truncation, tool calls,\n an unexpected response model, no text content, an empty reply, a reply over\n the output limit, or a reply that is not valid JSON (#4285);\n- for any other error (#4285), the code-defined constructor name (an\n identifier ending in `Error` or `Exception`; never the settable `name`),\n an `AbortError`/`TimeoutError` name, a network `code` from a closed list\n (`ECONNREFUSED`, `ECONNRESET`, `ETIMEDOUT`, `ENOTFOUND`, `EAI_AGAIN`,\n `UND_ERR_*`, TLS certificate codes, ...) read from the error, up to three\n `cause` levels and an `AggregateError`'s entries, and a structured numeric\n status. A timeout or abort is named as one, except that a structured HTTP\n status always wins over an abort name or network timeout code on a non-SDK\n error, whether on the error itself or in its cause chain. An SDK error's\n abort is read only from its code or exact transport message.\n\nFor example: `provider rejected the response schema (HTTP 400, code API_ERROR);\nunsupported response-schema keywords: uniqueItems`,\n`provider response incomplete (finish reason length)`,\n`provider call failed (class TypeError, network ECONNREFUSED)`,\n`provider call aborted or timed out (class DOMException, name TimeoutError)`, or\n`provider call failed (class Error)`. It is cut at 500 characters.\n\n**Why some failures were a bare `provider call failed` (#4285).** The SDK\nadapter's own response checks threw plain `Error`s (finish reason not `stop`,\ne.g. `length` when the reply reached `maxTokens`; truncation; tool calls; an\nunexpected response model; non-text or oversized content) and `JSON.parse`\nthrew a `SyntaxError` for an empty or non-JSON reply. The reason deliberately\nreads nothing from a non-SDK error, so all of these collapsed into the fixed\nphrase. Transport failures through the OpenAI SDK already carried\n`code API_ERROR`. The adapter now raises `ProposalResponseError` with a fixed\nproblem, and other non-SDK errors contribute the transport facts above. The\ncategory is unchanged (`unavailable`).\n\n### Host suggestion review (`reviewSuggestion`)\n\nA host's own checks on a generated suggestion (a label that is not the invoice\ndate, an amount that is not in the document) can hold it and leave a record a\nreviewer sees:\n\n```ts\nproposals: {\n // ...\n reviewSuggestion: ({ suggestion, handler, evidence }) => ({\n hold: true, // optional; forces needs_review\n reasons: ['total_not_in_text'], // optional; <= 8 codes, /^[a-z][a-z0-9_.-]{0,47}$/\n prefilled: ['billDate'], // optional; names declared in handler.argsSchema.properties\n }),\n},\n```\n\nThe hook is trusted, server-only and optional. It runs once per validated\nsuggestion, after validation and before the decision gate, with deep copies of\nthe suggestion, its offered handler and the retained evidence text. It cannot\nchange `args`, `missingFields`, evidence or the outcome except through `hold`,\nand it can never upgrade: `hold` sets the suggestion (and a `proposals` outcome)\nto `needs_review`; absent or `hold: false` leaves the validator's disposition.\n\nThe result is stored as `suggestion.hostReview` (`{held, reasons, prefilled}`)\nand counted in `provenance.hostReview` (`{annotated, held}`); both are absent\nwhen the hook records nothing. Values cannot be stored: unknown keys, free-text\nor over-long reasons, `prefilled` names that are not argument names, and any\nreason code containing one of the suggestion's own argument values (3+\ncharacters) make the result invalid. An invalid result, a throw, a rejection or\na hook slower than `limits.timeoutMs` holds the suggestion with the fixed code\n`host_review_invalid` or `host_review_failed`; the error text is discarded.\n`ReviewView` shows \"Checked by the shop: ...\" under the arguments.\n\nLike `failureCapture`, the hook is not public read configuration and never enters\nfrozen configuration or digests. Hosts keep it synchronous-cheap: it runs inside\nthe generation lease.\n\n### Failed-attempt capture (opt-in, #4285)\n\nThe value-free reason cannot show what the model actually sent. A host that\nneeds that for diagnosis can opt in to keeping it:\n\n```ts\nproposals: {\n // ...\n failureCapture: {\n enabled: true, // required; absent or false keeps capture off\n maxBytes: 16384, // default 16384, at most 65536 (UTF-8 bytes, after redaction)\n redact: ({ text, source }) => hostRedaction(text), // required to retain text\n },\n},\n```\n\n`ProposalConfiguration.failureCapture` is **off by default**. When enabled with\na host `redact` hook, a failed interpretation attempt (`provider_error`) keeps\none of:\n\n- `raw_response`: the reply text the SDK adapter refused (for example invalid\n JSON or a `length` finish), or\n- `generated_output`: the generator's parsed output, as JSON, that failed\n validation, the declared-completion check or the output limit.\n\nErrors without model output (transport, timeouts, authority, decision\nfailures) capture nothing. Successful attempts never store a capture.\n\nWithout a `redact` hook, only `status: 'redaction_failed'` metadata is stored,\nwith `redacted: false` and no text; the candidate text is not materialized.\nThere is no built-in sanitizer. Hosts own the hook's semantic redaction policy;\nthe service cannot verify that the returned text removes every document secret.\n\nThe text, cut to the larger of the generation `maxOutputBytes` and\n`maxBytes`, goes through the host `redact` hook, and the result is cut to\n`maxBytes` without splitting a character (`truncated: true` when either cut\napplied). NUL and unpaired surrogates are stored as U+FFFD so PostgreSQL JSON accepts the record. When\nthe hook throws, returns a non-string or exceeds its asynchronous wait budget,\nonly `status: 'redaction_failed'` is stored. The budget is the generation\n`timeoutMs`, cut to half of the analysis lease still left when the hook starts\n(no time left: the hook is not called). The hook runs after the authority\nrecheck, reserving the rest of the lease for the second recheck and publication.\nThis timer cannot preempt synchronous work or cancel the hook. Hosts must use\nbounded, nonblocking redactors. Missing or failed redaction does not replace the\nattempt's real failure or value-free reason; hook errors are discarded.\n\n**Where it lives.** In the attempt row's `data` JSON, as `failureCapture`\nbeside the result fields, never inside `result`: it needs no migration, is not\npart of `output_digest` or any configuration digest, never appears in\n`getCompletedAnalysis` or any other snapshot, and is not public read\nconfiguration (`proposalReadConfiguration` omits it, so read-only hosts still\nmatch). Proposal digests, replay and frozen generation configuration are\nunchanged by enabling it.\n\n**Reading it back.** Only\n`IngestionService.getFailedAttemptCapture(itemId, attemptId?)` returns it\n(`FailedAttemptCapture` from `/dto`, or `null` when nothing was stored). The\nattempt defaults to the item's current analysis attempt. It requires the\nexecution catalog and the current **reviewer** authority for that item (the\nsame gate as `getItemDisposition`) inside the caller's tenant and confidential\nscope; every denial, expiry, cancellation or foreign item fails closed before\nthe row is read. It is never part of a list DTO, inbox row, review page,\nlog line, checkpoint name, telemetry or error message.\nPublication and reads also reject a persisted `captured` record with\n`redacted: false`; capture text must be marked as processed by a configured\nhost hook. Persisted caps must remain within 1–65536 bytes, and captured text\nmust fit its declared UTF-8 byte cap; malformed records fail closed.\n\n**Retention and deletion.** It follows the item. There is no separate delete\nAPI: `expire`, `sweepRetention` and the `repairDeletions` retry of an\ninterrupted propagation all empty attempt `data`, which removes the capture\nwith the rest of the payload; a revoked item is unreadable before that.\n\n`createSDKProposalDecisionClient(client)` adapts an existing SDK client’s optional\ncapability without changing its errors or protocol. Optional `decision` uses public core `executeDecision` and the existing SDK\npredicate, choice, score and batch contracts. Supported-effect predicates,\nhandler classification, candidate entity matching, and action ambiguity/risk\nare distinct questions. Their validated probabilities and provenance are stored\nseparately from generative provenance and unknown OCR certainty. The complete\nserialized decision request, including suggestions and questions, must fit the\nminimum configured/current policy byte ceiling before capability probing and\nagain before deciding. A policy change between these boundaries fails closed.\nActually incomplete extraction always requires review. Unknown provider\ncompletion metadata is preserved as `source_completion_unknown`; it does not\nblock otherwise schema-valid **human** preview or imply completeness. Automatic\naction eligibility remains false. An unconfigured decision path\nis recorded explicitly. Configured errors produce a durable safe failure outcome;\nthey never silently switch to a generative decision fallback.\n\n### Decision readiness gate (#4209)\n\nFor every suggestion `i` the request asks `supported_i` (predicate),\n`route_i` (choice over the offered `handlerId@version` keys plus `none`),\n`risk_i` (ordered score over `clear`, `uncertain`, `ambiguous`) and one\n`entity_i_<field>` choice per candidate-reference argument. The validated\nanswers are always persisted under `provenance.decision.answers`. With the\ndefault `decisionReadiness: 'gate'` they are read as follows, and any failing\ncheck sets the suggestion to `needs_review` (a tie also sets the outcome to\n`ambiguous`):\n\n- `supported.probability >= minimumDecisionProbability` (default `0.8`).\n- `route.choice` equals the suggestion's own `handlerId@handlerVersion`,\n `route.confidence >= minimumDecisionProbability`, and the gap between the two\n largest route probabilities is greater than `tieMargin` (default `0.1`).\n- `risk.score < 1`: only the `clear` level passes; `uncertain` and `ambiguous`\n require review.\n- Each entity match chooses the suggested candidate's key with confidence at or\n above the threshold and a gap above `tieMargin`.\n\nThese values are provider outputs read as if they were calibrated\nprobabilities; nothing in this package calibrates them for this use. The\nteamworks-os measurement in #4209 (self-hosted Laya `typed-decisions`) found no\nseparation between right and wrong suggestions: a correctly read vendor invoice\nscored `supported` 0.37, garbage input 0.45–0.50, a wrongly proposed purchase\norder 0.51, route confidence 0.003–0.15 and `risk` ≥ 0.94, so the gate sent\nevery suggestion to review. Until a labelled sample shows separation, treat the\nanswers as diagnostics and configure:\n\n- `decisionMaxLen`: positive integer forwarded unchanged as the per-request\n `maxLen` of the decision client (the SDK Laya provider's token window; the\n checkpoint default is 1024 and the serialized evidence plus suggestions is\n otherwise truncated). Other clients ignore it.\n- `decisionReadiness: 'record'`: the decision still runs, is bounded and\n authorized exactly as before and its answers, usage, `readiness` and `maxLen`\n are recorded, but the gate never changes `outcome` or `disposition`; readiness\n comes from the validator alone (`missingFields`, outcome, source completeness).\n A client error or timeout is recorded as the `decision_unavailable`\n warning. A reply that comes back and then fails the core `executeDecision`\n identity or answer-shape check is recorded as `decision_malformed` with the\n reply's usage; this is the path for injected `DecisionClient`s. SDK clients,\n including the Laya provider behind `createSDKProposalDecisionClient`,\n validate the reply's shape inside `client.decide` and throw, so a malformed\n SDK reply is recorded as `decision_unavailable` with no usage. Every case\n records the `provenance.decision` identity. The generated suggestions stay\n as they were. The serialized request exceeding the byte budget is a\n configuration failure, not a provider answer: it ends the attempt as `limit`\n in both modes, and in `gate` mode every failure above still ends the attempt\n as `provider_error`. Lease, catalog, policy and provider-allowlist revocation\n fail closed in both modes.\n\nSuccessful output also records `provenance.decision.readiness` (`'gate'` or\n`'record'`) and `maxLen` when set; configuration digests are unchanged, but\npersisted output is therefore not byte-identical to earlier releases.\n\nBoth settings are public configuration: they are part of\n`ProposalReadConfiguration`, the frozen `GenerationStageConfiguration.proposals`\n(present only when set, so existing digests are unchanged) and the completed\nsnapshot authority check. Invalid values fail at proposal service construction.\nNeither mode affects automation: `automaticActionEligible` stays `false`, and\n`authorizeAutomatic` reads only the host's `evaluateAutomatic` callback and\npolicy, never these answers.\n\nOutput records zero, one or multiple suggestions, alternatives, missing fields,\nsource links, proposed splits, versions, allowlisted usage, warnings and explicit\n`unknown`, `ambiguous`, `no_action`, `needs_review` or `provider_error` outcomes.\n`automaticActionEligible` is always false. Provider input/output and the complete\nserialized persisted envelope are bounded by configuration, live policy and the\nreceipt ceiling. Oversized output becomes a bounded review/limit result; when\nno safe envelope fits, the owning service records fixed `failAnalysis` metadata\noutside the provider payload budget without retaining provider output.\n\n## Explicit preview and stable intentions\n\nThe host chooses persisted suggestion indexes and calls:\n\n```ts\nawait service.previewGeneratedProposals({\n itemId,\n attemptId: generationAttemptId,\n selections: [{\n index: 0,\n intentionKey: 'document:meeting-2026-10-09',\n expectedRevision: 0,\n requestId: 'review-request-1',\n }],\n});\n```\n\n`intentionKey` is the host's stable business-intention identity across generation\nrevisions. Never derive a fresh key from model output, suggestion order or a retry.\nSelections must reference current persisted validated `ready_for_review` or\n`needs_review` output (#4208); a `provider_error` attempt, an unoffered handler or\na non-interpretation stage is rejected. A `needs_review` suggestion whose\n`missingFields` are still absent fails the handler schema inside the ordinary\npreview (`HandlerArgumentsInvalidError`, `Invalid handler payload`, whose\nvalue-free `issues` name the missing schema fields, for example\n`{ path: '/title', keyword: 'required' }`; see REVIEW.md) and publishes\nnothing; the reviewer supplies\nthe missing values through the explicit human path (`previewProposal` /\n`previewPlan`, as the published review host does for `preview({args})`), and the\nhandler's `validate` and `preview` run again on the completed arguments.\nEach batch requires distinct suggestion indexes and intention keys; duplicate\nindexes are rejected before any operation or plan preview is written.\nThe service rechecks current catalog/schema/target/source provenance, then calls\nthe existing operation or plan preview. Each result still requires the ordinary\nhuman review and execution APIs. Reprocessing creates no new business identity;\nsuccessful-action replay protection stays with execution.\n\n## Evidence and limits\n\nThe test matrix is `docs/test-matrix/3673-ingestion-proposals.md`. SQLite and real\nPostgreSQL suites exercise authority, revisions, abstention, hostile output,\ncompound proposals, split provenance and reviewed domain effects. The upload\nreference composes authenticated multipart delivery of a generated embedded-text\nPDF through the actual packaged PDF child, durable interpretation, and the existing\nordered ContentDocument draft/retained-asset plan. It checks duplicate delivery,\nunauthenticated and foreign-tenant denial, explicit approval of both steps,\nidempotent execution replay, page provenance, and unchanged original bytes.\nThe compound-email case uses a declared messages-owner snapshot fixture.\n\nLocal HTTP fixtures execute the actual AI SDK transport and cancellation contract.\nGenerative responses and the separate injected PDF split boundaries establish\ndeterministic orchestration, not model accuracy or OCR quality. No held-out routing\nevaluation or automatic approval is claimed. Missing/unknown AI completion remains\nexplicit under [SDK #1381](https://github.com/happyvertical/sdk/issues/1381).\n\nProposal limits are checked at `IngestionService` construction: positive safe\nintegers, at most 20 handlers/candidates/suggestions and 2147483647 ms timeout.\nInterpretation output uses the exported `GenerationAnalysisOutput` wrapper at\n`analysis.result.output.proposals`; the published review host unwraps it.\nAn explicit feedback `retrieve` denial omits optional examples and feedback\nprovenance and continues generation. Item/execution denials, unexpected failures,\nand revocation after examples were selected still fail closed before disclosure.\n"
|
|
1724
1724
|
},
|
|
1725
1725
|
{
|
|
1726
1726
|
"path": "FEEDBACK.md",
|
|
@@ -1781,7 +1781,7 @@
|
|
|
1781
1781
|
"code": "not-module-scope",
|
|
1782
1782
|
"helper": "definePlaybook",
|
|
1783
1783
|
"message": "`definePlaybook()` must be called at module scope to be emitted into the manifest and knowledge graph. A declaration the scanner cannot read without evaluating it is not emittable — use `useWebMcpTool` for a tool set derived from computed or fetched data.",
|
|
1784
|
-
"line":
|
|
1784
|
+
"line": 8739,
|
|
1785
1785
|
"column": 9,
|
|
1786
1786
|
"sourceFile": "src/test-support/proposals.ts"
|
|
1787
1787
|
},
|
|
@@ -1789,7 +1789,7 @@
|
|
|
1789
1789
|
"code": "not-module-scope",
|
|
1790
1790
|
"helper": "definePlaybook",
|
|
1791
1791
|
"message": "`definePlaybook()` must be called at module scope to be emitted into the manifest and knowledge graph. A declaration the scanner cannot read without evaluating it is not emittable — use `useWebMcpTool` for a tool set derived from computed or fetched data.",
|
|
1792
|
-
"line":
|
|
1792
|
+
"line": 9368,
|
|
1793
1793
|
"column": 7,
|
|
1794
1794
|
"sourceFile": "src/test-support/proposals.ts"
|
|
1795
1795
|
}
|
|
@@ -821,6 +821,7 @@ onMount(() => {
|
|
|
821
821
|
{#each generation.warnings as warning}<p>{warning}</p>{/each}
|
|
822
822
|
{#each generation.suggestions as suggestion,index}
|
|
823
823
|
<article><h3>{suggestion.handlerId}</h3><p>{suggestion.explanation}</p><pre>{JSON.stringify(suggestion.args,null,2)}</pre>
|
|
824
|
+
{#if suggestion.hostReview}<p data-testid="host-review">{t(M['ingestion.hostChecked'], { summary: [suggestion.hostReview.held ? t(M['ingestion.hostHeld']) : '', suggestion.hostReview.prefilled.length ? t(M['ingestion.hostFilled'], { fields: suggestion.hostReview.prefilled.join(', ') }) : '', suggestion.hostReview.reasons.length ? t(M['ingestion.hostReasons'], { reasons: suggestion.hostReview.reasons.join(', ') }) : ''].filter(Boolean).join('; ') })}</p>{/if}
|
|
824
825
|
{#if suggestion.alternatives.length}<h4>{t(M['ingestion.alternatives'])}</h4><ul>{#each suggestion.alternatives as alternative}<li>{alternative}</li>{/each}</ul>{/if}
|
|
825
826
|
{#if suggestion.missingFields.length}<h4>{t(M['ingestion.missing'])}</h4><ul>{#each suggestion.missingFields as missing}<li>{missing}</li>{/each}</ul>{/if}
|
|
826
827
|
<ul>{#each suggestion.evidence as reference}{@const url = locationUrl(reference.evidenceId,reference.location)}<li>{#if url}<Button href={url} target="_blank" rel="noopener noreferrer">{locationLabel(reference.location)}</Button>{:else}{locationLabel(reference.location)}{/if}</li>{/each}</ul>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReviewView.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ReviewView.svelte.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAa5E,OAAqB,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAIzE,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CACP,IAAI,EAAE,cAAc,GAAG,SAAS,EAChC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,KACX,IAAI,CAAC;IACV,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IACrB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,mFAAmF;IACnF,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CACpE;
|
|
1
|
+
{"version":3,"file":"ReviewView.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ReviewView.svelte.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAa5E,OAAqB,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAIzE,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CACP,IAAI,EAAE,cAAc,GAAG,SAAS,EAChC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,KACX,IAAI,CAAC;IACV,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IACrB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,mFAAmF;IACnF,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CACpE;AAi1BD,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
package/dist/svelte/i18n.d.ts
CHANGED
|
@@ -57,6 +57,10 @@ export declare const M: {
|
|
|
57
57
|
readonly 'ingestion.invalid': "ingestion.invalid";
|
|
58
58
|
readonly 'ingestion.alternatives': "ingestion.alternatives";
|
|
59
59
|
readonly 'ingestion.missing': "ingestion.missing";
|
|
60
|
+
readonly 'ingestion.hostChecked': "ingestion.hostChecked";
|
|
61
|
+
readonly 'ingestion.hostHeld': "ingestion.hostHeld";
|
|
62
|
+
readonly 'ingestion.hostFilled': "ingestion.hostFilled";
|
|
63
|
+
readonly 'ingestion.hostReasons': "ingestion.hostReasons";
|
|
60
64
|
readonly 'ingestion.candidates': "ingestion.candidates";
|
|
61
65
|
readonly 'ingestion.search': "ingestion.search";
|
|
62
66
|
readonly 'ingestion.query': "ingestion.query";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsJZ,CAAC"}
|
package/dist/svelte/i18n.js
CHANGED
|
@@ -58,6 +58,10 @@ export const M = defineMessages({
|
|
|
58
58
|
'ingestion.invalid': 'Enter a valid JSON object or page groups.',
|
|
59
59
|
'ingestion.alternatives': 'Alternatives',
|
|
60
60
|
'ingestion.missing': 'Missing information',
|
|
61
|
+
'ingestion.hostChecked': 'Checked by the shop: {summary}',
|
|
62
|
+
'ingestion.hostHeld': 'held for review',
|
|
63
|
+
'ingestion.hostFilled': 'filled in: {fields}',
|
|
64
|
+
'ingestion.hostReasons': 'flagged: {reasons}',
|
|
61
65
|
'ingestion.candidates': 'Authorized destinations',
|
|
62
66
|
'ingestion.search': 'Search destinations',
|
|
63
67
|
'ingestion.query': 'Destination search',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-ingestion",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.33",
|
|
4
4
|
"description": "Durable tenant-scoped intake and evidence foundations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -50,32 +50,32 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@happyvertical/smrt-core": "0.57.
|
|
54
|
-
"@happyvertical/smrt-types": "0.57.
|
|
55
|
-
"@happyvertical/smrt-tenancy": "0.57.
|
|
56
|
-
"@happyvertical/smrt-assets": "0.57.
|
|
57
|
-
"@happyvertical/smrt-jobs": "0.57.
|
|
53
|
+
"@happyvertical/smrt-core": "0.57.33",
|
|
54
|
+
"@happyvertical/smrt-types": "0.57.33",
|
|
55
|
+
"@happyvertical/smrt-tenancy": "0.57.33",
|
|
56
|
+
"@happyvertical/smrt-assets": "0.57.33",
|
|
57
|
+
"@happyvertical/smrt-jobs": "0.57.33",
|
|
58
58
|
"@happyvertical/sql": "^0.108.0",
|
|
59
59
|
"@happyvertical/pdf": "^0.65.9",
|
|
60
60
|
"@happyvertical/ocr": "^0.62.1",
|
|
61
61
|
"@happyvertical/speech": "^0.108.0",
|
|
62
62
|
"@happyvertical/ai": "^0.108.0",
|
|
63
63
|
"sharp": "^0.35.5",
|
|
64
|
-
"@happyvertical/smrt-agents": "0.57.
|
|
65
|
-
"@happyvertical/smrt-playbooks": "0.57.
|
|
64
|
+
"@happyvertical/smrt-agents": "0.57.33",
|
|
65
|
+
"@happyvertical/smrt-playbooks": "0.57.33",
|
|
66
66
|
"ajv": "8.20.0",
|
|
67
|
-
"@happyvertical/smrt-ui": "0.57.
|
|
67
|
+
"@happyvertical/smrt-ui": "0.57.33"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@happyvertical/smrt-vitest": "0.57.
|
|
70
|
+
"@happyvertical/smrt-vitest": "0.57.33",
|
|
71
71
|
"@types/node": "24.13.6",
|
|
72
72
|
"typescript": "6.0.3",
|
|
73
73
|
"vite": "8.1.6",
|
|
74
74
|
"vitest": "4.1.10",
|
|
75
|
-
"@happyvertical/smrt-content": "0.57.
|
|
76
|
-
"@happyvertical/smrt-messages": "0.57.
|
|
75
|
+
"@happyvertical/smrt-content": "0.57.33",
|
|
76
|
+
"@happyvertical/smrt-messages": "0.57.33",
|
|
77
77
|
"@happyvertical/email": "^0.108.0",
|
|
78
|
-
"@happyvertical/smrt-users": "0.57.
|
|
78
|
+
"@happyvertical/smrt-users": "0.57.33",
|
|
79
79
|
"@sveltejs/package": "^2.5.8",
|
|
80
80
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
81
81
|
"svelte": "^5.57.1",
|