Deterministic assessment runner and exports
Use this command to turn approved metadata exports into linked evidence, machine observations and a proposed roadmap. Python stdlib only: no AI, connector, network, credentials or Snowflake execution. **Native execution and client assessment remain NOT RUN / NOT ASSESSED.** The report never upgrades a candidate into an owner-validated finding, assigns a real accountable person, invents benefits or authorizes remediation.
Run the vertical workflow
First follow capture to render worksheets and record each approved client-run CSV. Follow normalization for exact source and attributed manual-context contracts and advice for rule semantics and optional discovery mapping.
PYTHONPATH=src python -m sf_eval.assessment run \
--input /tmp/config-capture \
--input /tmp/load-capture \
--input /tmp/query-capture \
--context /tmp/owner-context.json \
--output /tmp/assessment-run--input repeats for separate source captures. --context is optional when owner facts are unavailable; their absence stays unknown. The minimal attributed context is:
{
"schema_version": "sf-assessment-context-v1",
"account": "EXAMPLE-ACCOUNT",
"evidence_kind": "synthetic",
"attributed_to": "Named owner or synthetic exercise author",
"attestation": "Dated, approved source reference; synthetic example only",
"warehouse_owner_targets_ms": {"APP_WH": null}
}Use client_metadata consistently for actual approved client evidence. Do not fill a latency target from a generic best practice; null is intentional. Optional --discovery /tmp/discovery.json uses advice's explicit control-to-discovery mapping, not free-text execution. Missing query IDs are never invented for manual evidence. Manual normalized QUERY_WORK requires the structured query_population: "SUCCESS_COMPLETED" declaration (capture CLI --query-population SUCCESS_COMPLETED), alongside attribution and operator attestation; free text never substitutes for it.
Separately normalized/evaluated artifacts may use whole-second or 1–6 fractional-digit UTC Z windows; reporting preserves that exact upstream representation and rejects naive timestamps or numeric offsets. Capture rendering continues to require whole-second config windows.
The runner creates fresh normalized/, evaluation/, and report/ subdirectories. Open report/index.html in a browser. A root manifest.json exists only after all three stages succeed and hashes their manifests. A failed run retains intermediates for diagnosis, produces a nonzero exit, and has no completion manifest; use a different fresh output for the next attempt. Inputs remain read-only. Output must be outside checkout, with an existing parent; traversal, symlinks and overwrite are refused.
To rebuild presentation from already evaluated evidence:
PYTHONPATH=src python -m sf_eval.assessment report \
--input /tmp/assessment-run/evaluation \
--output /tmp/reformatted-reportThe reporter checks all three evaluation payload hashes against manifest.json before reserving output. It compares the embedded catalog's semantic content to the shipped catalog and verifies both its retained raw catalog checksum and canonical catalog checksum. It validates exact source/evidence populations and their source/query/checksum/window provenance, then rebuilds expected observations with the same pure rule function over retained query results. Stable IDs, measurements, rule/query/control/classification/validation fields, required source populations, embedded evidence, evidence IDs and source query IDs must all match that reconstruction; extra, missing or mismatched observations fail closed. Narrative observation and proposed_owner_role display strings remain untrusted presentation text and are escaped, not treated as acceptance or authority.
Evaluations now retain query_execution_status and discovery_payload_base64 in results. The latter contains exact discovery JSON bytes when a mapping was supplied, checked against discovery_sha256 in results and the evaluation manifest. Without a mapping both discovery checksum and payload are null, and all observation discovery references must be empty. With a mapping, primary and related control references must match its parsed contents exactly; a checksum alone is not a mapping. Existing older evaluations lacking the new canonical catalog checksum or execution/discovery evidence must be regenerated using the current advice command. No file or checksum authenticates a coherently replaced set of artifacts; client approval and custody remain separate. JSON files are bounded at 64 MiB each, observations at 100000 and evidence at 1000. Hashes detect content mismatch; neither files nor supplied attestations authenticate client approval. Keep approved artifacts in the client's controlled evidence store.
Delivered files and interpretation
| File | Meaning |
index.html | Escaped standalone HTML, provenance, source statuses/window/limitations, linked observations and proposed roadmap. No JavaScript or remote assets. |
observations.csv | Stable observation/rule/control/discovery/evidence links, original classification, measurements, hypothesis, proposed remediation, prerequisites, alternatives, proposed owner role and future acceptance. |
evidence.csv | Individual source statuses, query IDs where supplied, hashes, source records including row counts/window, manual attribution and limits. |
proposed-roadmap.csv | Candidate observations only, each with stable R-<observation_id>, linked observation and PROPOSED_UNVALIDATED status. Contextual, strength and insufficient-evidence outcomes remain in observations. |
control-coverage.csv | All 74 unchanged catalog controls with linked machine observations; every client assessment remains NOT_ASSESSED. A link is not full control implementation or acceptance. |
results.json, observations.json, remediation-catalog.json | Exact evaluated JSON bytes; presentation safety does not rewrite evidence. |
evaluation-manifest.json, manifest.json | Preserved input manifest plus report hashes, evidence label, window and catalog checksum. |
Classification and validation state remain separate: a candidate is proposed owner review; insufficient evidence is an open evidence gap. An empty roadmap does not mean the estate is healthy. PARTIAL, EMPTY, DENIED, UNSUPPORTED and UNKNOWN remain visible, and incomplete sources suppress conclusive advice under the rule engine. Null measurements remain null, never zero. Repeated reports from identical evaluated inputs are byte-identical.
HTML escapes untrusted text. CSV prefixes potentially active formula values (including whitespace-prefixed =, +, -, @ and embedded CR/newline/tab) with an apostrophe. This presentation change is intentional; use preserved JSON for exact values. Do not treat raw captured exports as safe spreadsheet workbooks. Generated identifiers are stable links, not public URLs; reports contain approved metadata and need the same client access controls as source evidence.
Permissions, mapping and limits
The runner only needs local read access to capture/context/discovery files and local write access to a new output directory. It needs no Snowflake privileges. Client collection is a separate approved operator action under the capture guide's least-privilege procedure; denied access requires owner/admin resolution, not a broader local role or fabricated replacement data.
The actual four practices analyses and versioned rule catalog determine observation/control mapping. No new coverage claims are added to the protected 74-control catalog. Source privilege completeness, representative workloads, business priorities, effective privacy protection, root causes, actual savings, implementation ownership and acceptance remain manual validations. Failed/in-flight/cross-window warehouse queries are outside the supported successful completed-query export population. No health score or automatic remediation is produced.
Estate/cost/ingestion/recovery extension outputs are separate evidence artifacts in this release; the runner does not silently merge separate schema namespaces. Run that tool independently and present its distinct input contract/limitations alongside this report. Unsupported sources require the documented approved manual route, not arbitrary SQL files.
Troubleshooting and checks
A hash error means preserve and investigate the source artifact; do not rewrite hashes merely to make it pass. A fresh-output error means select a new destination. A provenance/context error means supply the documented attribution/identity or retain the source as unknown. Native timestamp/header failures require the exact rendered columns and UTC formatting. A failed pipeline's intermediate directories are diagnostic only until the root completion manifest exists.
PYTHONPATH=src python -m unittest discover -s tests -p test_assessment_report.py -vThe tests run actual subprocess pipelines with synthetic native-shaped exports and attributed context, check 74 unassessed controls, partial/unknown behavior, nulls, deterministic repeats, hash tampering, symlinks, overwrite refusal and malicious HTML/spreadsheet strings. They establish offline preparation only; no native/client qualification is implied.
Strict retained provenance format
Current evaluations additionally retain results.normalized_manifest_payload_base64 (the exact normalized-manifest bytes, checked against manifest.normalized_manifest_sha256) and results.query_work_ids (the actual QUERY_WORK identifier population read from the validated read-only database). Report validation uses the same pure normalize.validate_provenance contract as normalization: exact source tables/kinds; integer count/cap rules; COMPLETE nonempty and below cap; at-cap PARTIAL; no data rows for EMPTY/DENIED/UNSUPPORTED/UNKNOWN; source windows and UTC observed time; native query IDs; manual source, attribution, query-population declaration and attestation; relative CSV/checksum provenance. Embedded evidence source records must both pass that typed contract and match the retained normalized provenance. Boolean/float counts cannot pass by equality with integers.
For raw_query_history, query identifiers must be unique and their exact set and count must equal the retained SUCCESS execution map and QUERY_WORK source count. Missing, extra, failed or invalid map entries fail. Manual normalized/context query sources retain their SUCCESS_COMPLETED declaration but cannot claim a native execution map. Other missing query sources have an empty population and empty map. native_execution must remain exactly NOT_RUN: recording client-supplied query IDs does not turn this offline tool into a native executor.
The complete manifest.code_sha256 key population and every value must match the shipped evaluation implementation, metadata/normalization helpers, schema/control/query catalogs and actual practice SQL. Missing or additional entries and changed digests are rejected. This prevents internally false retained provenance; it does not authenticate a coherently substituted artifact set or prove client execution. Older evaluations lacking the strict retained normalized-manifest/population fields must be regenerated with the current advice command. The report remains bounded at 64 MiB per JSON payload; oversized artifacts require a smaller approved export/window, never silent truncation.
Retained normalized manifests use the exact generated key set: unknown fields, including an unsupported top-level manual_context_sha256, are rejected. The attributed manual-context checksum is stored only as manual_context_source.sha256; reports do not reconcile invented aliases. Normalization stages and fully validates privately under the approved destination parent before placing its fresh final directory; ordinary validation errors leave no requested normalized output. Regenerate invalid older artifacts instead of changing hashes.