# Prepare a paper's experiment-expense evidence pack

Ask for the paper/project identifier, the experiment interval and timezone,
accounts involved, and the institution's requested documents. Do not submit a
claim, log into accounts, or collect admin keys without explicit authorization.

1. Run `python3 -B -m unittest test_reconcile.py` and `python3 -B reconcile.py`.
   These use fictional normalized rows, not provider API response formats.
2. Have each account owner export authorized cost records and billing documents.
   For an API connector, consult the current provider docs, handle pagination,
   exclusive interval ends and the reporting timezone, and record export time.
   Keep provider admin credentials with the account owner, out of prompts/logs.
3. Preserve originals. Normalize monetary amounts as decimal strings, retaining
   provider, account, currency, stable source row ID, signed credit adjustments,
   and a source-file reference. Do not combine usage estimates, prepaid top-ups,
   invoices and cost rows as if they were separate expenses for the same work.
4. Map rows to the paper using dedicated provider projects or recorded run IDs.
   Keep an attribution reference. Shared keys and aggregate daily costs may not
   establish paper ownership. Put ambiguous rows in a review list; do not infer
   exact attribution from dates, titles or token proportions without approval.
5. Use reconcile(rows, paper) for the small demo. Real exports need versioned
   adapters and tests. Keep different currencies separate. The demo's totals
   include attributed costs missing documents; they are not approved claim totals.
6. Only if repeated multi-owner access is useful, expose an owner-scoped read-only
   report through the existing EasyNet function-connection guide. Enforce caller
   access to a fixed project and interval server-side. A caller-supplied paper ID
   is a filter, not authorization. Test a different caller is denied. No need to
   run experiments across two devices just for this task.
7. Produce draft-summary.csv, needs-review.csv, a source manifest and a document
   index in a new user-approved output directory. Never overwrite originals.
   Reconcile totals against platform billing, including shared usage, tax, credits,
   currency conversion and missing periods. Obtain finance review of allocation,
   reimbursement eligibility and exchange-rate evidence; do not fabricate invoices.

References:
- https://platform.openai.com/docs/api-reference/usage
- https://platform.claude.com/docs/en/manage-claude/usage-cost-api
- https://easynet.run/docs/connect/function
