---
title: Finance Core execution boundary
description: Run the pinned captured-source diagnostic and identify the remaining host integration.
owner: engineering
sourceFiles:
  - scripts/finance-core/diagnostic.ts
  - scripts/finance-core/diagnostic.test.ts
  - scripts/finance-core/probe.ts
  - scripts/finance-core/fixture.py
---

The [synthetic probe](/reference/cli#finance-core-diagnostic-probe) executes Finance Core's real `captured-source-diagnostic` CLI and checks its draft receipts. This is a callable host building block contributing to WB-22; it is not an end-user Finance workflow or completed financial acceptance.

## Source provenance

The boundary pins private `CreditWurthy/finance-core` revision `80355525512bbcde30703ff8f702caa63332190f`, package `0.2.0-preparation.2`. It exports that exact Git object into a scoped temporary directory rather than executing the installation's working tree. It never downloads a moving branch. The Python interpreter and its installed dependencies remain trusted host inputs.

The source contracts are [agent interface](https://github.com/CreditWurthy/finance-core/blob/80355525512bbcde30703ff8f702caa63332190f/docs/agent-interface.md), [complete financial jobs](https://github.com/CreditWurthy/finance-core/blob/80355525512bbcde30703ff8f702caa63332190f/docs/complete-financial-jobs.md), and [Workbench integration](https://github.com/CreditWurthy/finance-core/blob/80355525512bbcde30703ff8f702caa63332190f/docs/workbench-integration.md). The probe's invented reports follow that strict five-report profile and explicit observation rubric. No client files or external repository changes are involved.

## Host responsibilities and returned drafts

`executeDiagnostic` accepts trusted actor, firm, client, space, item and run identity, an explicit capability grant, a month-end cutoff, and six versioned evidence captures. Five are supported QBO-profile XLSX reports; one is the observation JSON. Each capture carries firm/client/space identity, immutable version, ID, cutoff, currency, basis, SHA-256 and bytes. Report captures must explicitly declare their export type and complete coverage. The host must authenticate the actor, resolve current grants and authorize each version before calling this boundary. Neither a supplied identity nor matching hashes establish permission, financial truth or source completeness.

The boundary rejects cross-scope captures, missing grants, duplicate source IDs, incorrect hashes and captures above 8 MiB. It creates its own snapshot paths and upstream receipts, permits only the diagnostic tool, and uses Effect's scoped process APIs with a 90-second overall budget and 16 MiB stdout limit. Temporary package, context and snapshot files are removed on completion, failure or interruption. There are no automatic retries.

Core validates layout, coverage, cutoff, currency, basis, observations and source controls. Unsupported inputs fail rather than producing a partial grade. Results must retain the requested scope, source hashes, preparation/draft status, unrequested approval, undelivered status and empty effects. Both artifact hashes, filenames, media types and the JSON period/scope are checked. The returned typed receipt includes original immutable source versions and host identity alongside actual UTF-8 `diagnostic.md` and `diagnostic.json` bytes. Upstream's standalone files and nested result scope identify client/space; item/run attribution comes from the validated outer envelope and host receipt. If nested scopes additionally supply item/run IDs, conflicting values are rejected even when the artifact hash matches. Keep the host receipt with the draft bytes when saving them.

| Failure code | Meaning |
| --- | --- |
| `INVALID_CAPTURE` | Host capture scope, grant, identity, size or hash check failed |
| `PACKAGE_FAILURE` | Package extraction, process, filesystem, dependency or time budget failed |
| `CORE_FAILURE` | Core rejected the request; `coreCode` retains its public error code |
| `INVALID_RESULT` | Response, scope, source manifest, status or artifact validation failed |

A Python failure without a valid JSON envelope is an invalid result. No draft is accepted from a failing process.

## Verification and remaining acceptance

The probe checks twelve-month income `12 × 500 = 6000`, expenses `12 × 100 = 1200`, one transaction, close discipline `needs_attention`, and reconciliation currency `solid`. Expected financial values are checked in both returned metrics and actual JSON artifact bytes. Two runs must produce identical receipts. Changed-hash, cross-client, withheld-capability and missing-observation variants must fail. Unit tests protect receipt scope (including conflicting nested item/run IDs), period, bytes, source population and absence of external effects at the save boundary; they do not certify financial calculations.

This strict source-preparation profile supports USD/accrual and explicitly empty AR/AP only. Supplied observations are not independently verified. Bank-statement ties, source completeness, broader layouts, reviewer isolation and financial review remain unproved. Phil/Tara's agreed cases and review are still required for WB-22 acceptance.

The caller receives draft bytes; no durable save receipt is fabricated. The future host adapter must load authorized immutable workspace evidence, persist drafts with item revision checks and stable operation IDs, and recheck grants at execution/save. Durable files, shared-item/conversation references, approval, recovery and later publication must use their owning Workbench services. Provider refresh and shared publication are separate authorized boundaries. This slice adds no HTTP service, persistence schema, Executor host, agent or schedule. A deployed end-to-end preview remains required before claiming an integrated feature.
