# Investment-policy worked example — version 1

Prepared with AI assistance and executed on 2026-11-12. All holdings, instruments,
fund constituents and returns are invented. No personal data, market-data
service, model API, broker credentials or Investboard account is required.

## What actually ran

- Six exact-arithmetic policy scenarios: three need more information, two contain
  known breaches, and one is within the enumerated checks.
- Ten standard-library unit tests covering known answers, missing fund weights,
  snapshot dates, inclusive boundaries, an overdraft and a cash deposit.
- Two skfolio 1.12.9 minimum-variance fits with CLARABEL 0.11.1 on the same 240
  artificial observations: without and with our numerical policy constraints.
- A constant cash series rejected by the tested default covariance estimator.
- An intentionally impossible combination of equity bounds rejected as infeasible.

No AI answer, real investment return, broker action or authenticated product
connection was tested. An outcome within these checks is not authorization or
an investment recommendation. The reference checker is deliberately narrow; it
does not parse arbitrary prose policies or validate every malformed input.

## Inputs and outputs

| File | Role |
| --- | --- |
| `policy.json` | Canonical example limits, denominators, authority and fixed dates |
| `holdings.csv` | Four invented EUR market values totaling 100,000 |
| `fund-holdings.json` | Complete invented equity-fund constituent weights |
| `scenarios.json` | Six case definitions and expected classifications |
| `investing.md`, `investing.de.md` | Readable policy in English and German; a teaching format, not an Investboard export |
| `review-request.md`, `review-request.de.md` | Proposed prompts, not observed model transcripts |
| `synthetic-returns.csv` | Artificial optimizer inputs; observations have no market dates |
| `reproduce.py` | Offline reference calculations and optional skfolio experiment |
| `test_policy.py` | Ten boundary tests independent of the optimizer |
| `requirements.lock` | Exact packages resolved for the recorded full run |
| `results.json` | Observed outputs; the article tables use these values |
| `sources.json` | Immutable upstream source references and reviewed public product pages |
| `manifest.json` | SHA-256 of every other published packet file |

The cash return column has small artificial variation. It is not a real cash
history or interest model. Other columns are deterministic combinations of sine
and cosine waves. The checked-in CSV is the authoritative input; this is a
constraint demonstration, not a backtest, forecast or comparison of strategies.

## Reproduce without third-party packages

Unpack the archive and enter its directory. With Python 3.9 or newer:

```bash
python3 -m unittest -v test_policy
python3 reproduce.py --policy-only --verify
```

The policy checker uses exact fractions. Known breaches take precedence over
missing information, while unresolved rules remain visible in `checks`. A
missing, partial, stale or future-dated fund snapshot cannot clear the issuer
rule. Its denominator is total equity value; allocation limits use total value.

## Reproduce the optimizer

The full run used CPython 3.12.12 on macOS arm64. Use a fresh Python 3.12
environment, not the website's JavaScript dependencies:

```bash
python3.12 -m venv .venv
.venv/bin/python -m pip install -r requirements.lock
.venv/bin/python reproduce.py --verify --output observed-results.json
```

`--verify` compares the six complete policy results with the published results,
checks the successful model bounds, checks both failure diagnoses and compares
solver weights within 0.000001. `--output` writes a separate result. Neither
command overwrites `results.json` unless you explicitly choose that path.
Different numerical platforms can exceed the recorded tolerance; investigate
the environment and outputs instead of replacing the reference silently.

The fitted weight model encodes allocation and instrument bounds only. The
separate policy checker handles issuer look-through and snapshot-age rules.
Human approval remains a workflow instruction; neither script calls a broker.
Fees, taxes, FX, price changes, pending transactions and personal suitability
are outside this example. A hypothetical EUR 5,000 deposit is a unit test, not
one of the six published purchase scenarios.

## Verify file integrity

```bash
python3 - <<'PY'
import hashlib, json, pathlib
root = pathlib.Path('.')
for name, expected in json.loads((root / 'manifest.json').read_text())['files'].items():
    assert hashlib.sha256((root / name).read_bytes()).hexdigest() == expected, name
print('Packet file checksums verified')
PY
```

`manifest.json` does not hash itself. The companion archive checksum is published
as `investment-policy-worked-example.zip.sha256`. Checksums verify the published
bytes; they do not verify financial conclusions or create trust in a source.

## Source and product boundaries

The reviewed skfolio v1.12.9 tag resolves to commit
`7721090537634a549008a546c8968cdec0eaf69a`. Source paths, Git blob IDs and PyPI
distribution hashes are recorded in `sources.json`. Upstream source code is
linked, not vendored. Resolved dependency versions are also in `results.json`.

David Bartas runs InvestingStack and founded Investboard. Public builder and
toolkit pages were checked as product documentation. This packet was not
generated by, imported into or connected to Investboard. Its fictional portfolio
is different from the product demo. No format-compatibility claim is made.

Original fixture data and prose: CC BY 4.0. Original Python scripts: MIT; see
`LICENSE.txt`. Third-party dependencies and referenced sources retain their
own licenses. Cite InvestingStack, the article URL, packet version and manifest.
