Cost, ingestion and recovery evidence review
This separate offline stdlib command reviews explicitly prepared metadata and owner requirements. It adds bounded evidence for COST-01/02, INGESTION-01/05 and RECOVERY-01/04. It does not revise the sealed 74-control catalog, classify overall platform health, prove savings or recovery, authorize new exercises, or create owner-validated client findings.
The operator obtains approval for service population, historical period, account/role declarations, source visibility, requirements and artifact handling. Prepare the exact CSVs below from authorized metadata and existing owner registers. No native connector or collection query is supplied by this extension. Do not export patient rows, SQL, binds or unrelated sensitive columns. Native CSV provenance means a client-authorized query ID was supplied; its truth remains an attestation. A mapped/interview register should use manual provenance instead of inventing a query ID.
Run
PYTHONPATH=src python3 -m sf_eval.estate --help
PYTHONPATH=src python3 -m sf_eval.estate --input /tmp/estate-evidence --output /tmp/estate-review
PYTHONPATH=src python3 -m unittest discover -s tests -p test_estate.py -v/tmp/estate-evidence must contain manifest.json and the declared CSVs. Output must be a fresh directory outside the checkout. Run the extension separately from sf_eval.assessment; keep its results beside the main report. It does not silently merge independent evidence into normalized practices data.
Exact manifest
The object has exactly these keys. sources can contain any subset of COST, INGESTION, RECOVERY; a missing source becomes UNKNOWN. service_population is the exact approved allowlist, not a completeness claim about all account services. No cross-service total is inferred. cost_comparison_basis is SAME_BASIS_COMPLETED_PERIOD or null; the former explicitly attests comparable metered/billed/allocated definitions and adjustment treatment. allocation_required is true, false or null. Null context prevents a positive conclusion.
{
"schema_version": "sf-assessment-estate-input-v1",
"evidence_kind": "synthetic",
"account": "TEST_ACCOUNT",
"role": "TEST_ROLE",
"window_start": "2026-11-01T00:00:00Z",
"window_end": "2026-11-02T00:00:00Z",
"row_limit": 100,
"requirements": {
"attributed_to": "Named accountable owner",
"artifact": "Approved requirements register reference",
"attestation": "Owner reviewed the declared population, basis and row requirements",
"service_population": ["COMPUTE"],
"cost_comparison_basis": "SAME_BASIS_COMPLETED_PERIOD",
"allocation_required": true
},
"sources": {
"COST": {
"file": "cost.csv",
"sha256": "REPLACE_WITH_SHA256_OF_EXACT_CSV_BYTES",
"row_count": 1,
"status": "COMPLETE",
"source_kind": "manual_csv",
"query_id": null,
"manual_source": "Approved finance register reference",
"observed_at": "2026-11-03T00:00:00Z",
"attestation": "Owner reconciled this completed period and service basis"
}
}
}Source objects have exactly the illustrated nine keys. Every source requires observation time and nonempty attestation. manual_csv requires manual_source and null query_id. native_csv requires null manual_source; COMPLETE/EMPTY native records require their true query_id. The tool does not authenticate approval or inspect the underlying query. File names must be single local .csv names. No directory traversal or symlinks are accepted.
States are COMPLETE, PARTIAL, DENIED, UNSUPPORTED, EMPTY and UNKNOWN. COMPLETE requires 1..row_limit-1 rows; a reached cap must remain PARTIAL. EMPTY/DENIED/UNSUPPORTED/UNKNOWN require zero rows. A zero-row source may have an exact header-only hashed CSV or null file/checksum. Positive/contextual observations require COMPLETE source evidence; partial/denied/missing evidence remains insufficient even when supplied measurements look favorable. No data rows are silently removed.
Exact CSV contracts and calculations
CSV column order may differ; the column set must match exactly. No extra sensitive columns, repeated headers, short/long records or duplicate source identities are accepted. Empty cells mean missing, not zero. Numeric cells are unsigned decimal strings up to 18 fractional places and maximum 10^24; NaN/infinity/negative values are rejected. Counts and retention days must be integral. UTC times use YYYY-MM-DDTHH:MM:SS[.ffffff]Z. JSON source counts and caps are integers, not booleans.
| Source | Exact header columns |
| COST | SERVICE,PERIOD_START,PERIOD_END,METERED_CREDITS,BILLED_CREDITS,ALLOCATED_CREDITS,RATE_PER_CREDIT,CURRENCY |
| INGESTION | SERVICE,INTERFACE_ID,BATCH_ID,SOURCE_ROWS,LOADED_ROWS,REJECTED_ROWS,SOURCE_CUTOFF_UTC,CONSUMER_AVAILABLE_UTC,FRESHNESS_TARGET_SECONDS |
| RECOVERY | SERVICE,OBJECT_TYPE,OBJECT_REFERENCE,CONFIGURED_RETENTION_DAYS,REQUIRED_RETENTION_DAYS,EXERCISE_EVIDENCE,RPO_SECONDS,RTO_SECONDS |
Each SERVICE must match the allowlist. CSV context requirements are covered by the named requirements owner/artifact/attestation; they are supplied facts, never defaults. Missing values retain uncertainty. Keep filenames and object references metadata-only and suitable for approved recipients.
**Cost:** identity is service plus period start/end. Each completed period must lie within the assessment window and end by source observation time. Metered, billed and allocated credits must describe the same service/period and approved basis. billed_minus_metered_credits = BILLED_CREDITS - METERED_CREDITS; a nonzero difference is a reconciliation candidate, never automatically a wrong bill. unallocated_billed_credits = BILLED_CREDITS - ALLOCATED_CREDITS; positive remainder is a candidate only if allocation is required. Allocation above billed credits is insufficient evidence requiring reconciliation. No accountwide completeness or cross-row/overlapping-period aggregate is implied.
A supplied positive RATE_PER_CREDIT requires an explicit three-letter uppercase currency; currency without rate rejects. billed_currency_amount = BILLED_CREDITS * RATE_PER_CREDIT, rounded once to two decimal places using ROUND_HALF_UP. These are illustrative supplied-rate amounts; the tool does not know actual currency-specific minor units, discounts, taxes or invoice terms. Missing rate produces NO_RATE_NO_CURRENCY and a null amount. Decimal arithmetic uses precision 100; no default prices, idle-cost estimates, avoidable-spend claims or savings calculations exist.
**Ingestion:** identity is interface plus batch ID; duplicates reject instead of double counting retries. unreconciled_rows = SOURCE_ROWS - LOADED_ROWS - REJECTED_ROWS. Nonzero differences or known rejected rows are review candidates; zero rejects and exact reconciliation remain contextual. Known reconciled totals never erase reject disposition. Missing counts remain insufficient. Business freshness is exact UTC consumer availability minus source cutoff, including microseconds, compared with the explicitly supplied owner target. Both times must be in the assessment window; availability cannot precede cutoff or postdate observation. No target or timestamp is inferred from job success. Missing targets/timestamps remain unknown.
**Recovery:** identity is service, object type and object reference. Retention below an explicit approved requirement is a candidate for design review; configuration meeting it is contextual only. RPO/RTO are optional declared seconds, with no inferred attainment. A supplied EXERCISE_EVIDENCE reference is available for owner review; it does not prove an exercise passed, validate its date/scope or establish effective recovery. Missing exercise evidence is insufficient. Review existing evidence and alternative recovery designs; no paid feature or new exercise is mandated or authorized.
Standalone synthetic rehearsal
This command creates a fresh, clearly synthetic one-row cost export; it never connects to an account. Use a fresh rehearsal root if the path already exists.
python3 - <<'PY'
import csv, hashlib, json
from pathlib import Path
root = Path('/tmp/estate-rehearsal-input'); root.mkdir(mode=0o700)
path = root / 'cost.csv'
with path.open('w', newline='') as f:
w = csv.writer(f)
w.writerow('SERVICE PERIOD_START PERIOD_END METERED_CREDITS BILLED_CREDITS ALLOCATED_CREDITS RATE_PER_CREDIT CURRENCY'.split())
w.writerow(['COMPUTE','2026-11-01T00:00:00Z','2026-11-02T00:00:00Z','10','12','9','',''])
m = dict(schema_version='sf-assessment-estate-input-v1', evidence_kind='synthetic', account='TEST_ACCOUNT', role='TEST_ROLE',
window_start='2026-11-01T00:00:00Z', window_end='2026-11-02T00:00:00Z', row_limit=100,
requirements=dict(attributed_to='Fictional rehearsal owner',artifact='Synthetic example',attestation='Synthetic only',
service_population=['COMPUTE'],cost_comparison_basis='SAME_BASIS_COMPLETED_PERIOD',allocation_required=True),
sources=dict(COST=dict(file='cost.csv',sha256=hashlib.sha256(path.read_bytes()).hexdigest(),row_count=1,status='COMPLETE',
source_kind='manual_csv',query_id=None,manual_source='Synthetic example',observed_at='2026-11-03T00:00:00Z',attestation='Synthetic only')))
(root/'manifest.json').write_text(json.dumps(m))
PY
PYTHONPATH=src python3 -m sf_eval.estate --input /tmp/estate-rehearsal-input --output /tmp/estate-rehearsal-reviewExpect a 2-credit comparison gap, 3 unallocated billed credits, no currency amount, and insufficient ingestion/recovery evidence. These are synthetic review candidates, not client observations.
Outputs and traceability
results.json (sf-assessment-estate-results-v1) contains exact decimal-string metrics, declared identity/window, owner requirements, source states and evidence records retaining source checksums/query IDs/manual provenance. observations.json (sf-assessment-estate-observations-v1) contains proposed observations with deterministic identity, versioned rule/control IDs, affected reference, evidence/source query IDs, classification, proposed owner, hypothesis, prerequisites, alternatives, remediation and future acceptance. All retain validation_status: proposed_owner_review; contextual does not mean verified healthy. Missing sources generate explicit insufficient records.
manifest.json (sf-assessment-estate-evaluation-v1) records input manifest/rule SHA256 and a files map of results.json/observations.json to exact SHA256 bytes, alongside account/role/window/evidence kind and source states. Repeated identical logical evidence produces identical observation IDs; changed evidence gets a new ID. Checksums provide tamper detection, not authenticated source or owner authority. Untrusted free text remains JSON data; a downstream HTML/CSV exporter must escape it.
Limits: at most 10,000 rows per source, 1,000 service names, 4,096 characters per text value and 20 MiB per input file. Inputs remain unchanged. No arbitrary SQL, network, account writes, credentials, LLM dependency, silent retries, overwrite, symlink or in-checkout output. Malformed data aborts before output creation. Unexpected output filesystem errors can leave an incomplete directory; use a fresh destination after investigating. Native compatibility/client access and independent engineering acceptance are separate gates.