<< All versions

Skill v1.0.0

currentTrusted Publisher100/100
microsoft/haste/deterministic-scripts
──Details
PublishedOctober 2, 2026 at 01:03 AM
Content Hashsha256:1551fdb269d02d9d...
Git SHA
──Files
Files (1 file, 4.3 KB)
SKILL.md4.3 KBactive
SKILL.md · 88 lines · 4.3 KB

version: "1.0.0" name: deterministic-scripts description: "Deterministic script execution skill for HASTE. Execute scripts instead of free-form LLM behavior for consistent, repeatable operations. Use when: 'run preprocessing', 'convert format', 'parse metadata', 'generate tiles', 'build wheel', 'deploy functions'. Prevents hallucinated scripts." source: "HASTE operational scripts, build system" domain: "operations" level: "foundational" agents: ["backend-dev", "gis", "backend-validation"] created_date: "2026-04-27" last_validated: "" validated_by: "" status: "draft"


Deterministic Script Execution

Overview

HASTE has established scripts and commands for common operations. Agents must use these exact commands instead of generating free-form alternatives. This prevents hallucinated scripts, ensures consistency, and makes operations repeatable.

Key Concepts

Why Deterministic Scripts Matter

  • LLMs can "helpfully" generate plausible-looking but incorrect commands
  • HASTE has specific build tooling (hatch, conda) that must be used correctly
  • Azure Functions deployment has specific prerequisites and ordering
  • Geospatial processing requires exact GDAL/rasterio invocations

Patterns & Techniques

Build & Package Operations

OperationExact CommandNotes
Build core wheelcd hastelib && hatch build -t wheelAuto-increments version, copies to func apps
Run Python testscd hastelib && hatch run test:pytestUses conda env with GDAL
Build UIcd ui && npm run buildProduction build via Vite
Lint UIcd ui && npm run lintESLint with React rules
Install UI depscd ui && npm installUses package-lock.json
Create conda envconda env create -f env.ymlFull env with GDAL and dependencies
Update conda envconda env update -f env.ymlPreserves existing packages
Install hastelib editablepip install -e hastelib/For local development hot-reload

Local Development

OperationExact CommandNotes
Start API locallycd api/hastefuncapi && func host startRequires .venv or conda env
Start UI locallycd ui && swa start --app-devserver-url http://localhost:5173 --run 'npm run dev'SWA CLI with Vite dev server
Start Azuriteazurite --silent --location ./data --debug ./data/debug.logLocal Azure Storage emulator
Start Docker stackdocker-compose -f docker/docker-compose.yml upFull local stack

Deployment

OperationExact CommandNotes
Deploy Azure Functionfunc azure functionapp publish <NAME> --subscription <SUB> --tenant <TENANT>After hatch build
Deploy SWAcd ui && swa deploy --app-location ./dist --app-name <NAME>After npm run build
Build Docker images./build_and_push_images.shBuilds training + imagery prep images

Imagery Processing

OperationApproachNotes
COG generationUse rasterio with COG driver profileNever use raw GDAL CLI unless wrapping in Python
Tile generationThrough ImageryPreProcessorNot manual gdal2tiles
Reprojectionrasterio.warp.reproject()Always specify src_crs and dst_crs
Format conversionThrough provider-specific adapterNot generic gdal_translate

Decision Framework

SituationDo ThisNOT This
Need to run testshatch run test:pytestpytest (wrong env)
Need to build wheelhatch build -t wheelpython setup.py bdist_wheel
Need to start APIfunc host startpython function_app.py
Need Azure storage locallyazuriteCustom mock storage
Need to process imageryUse ImageryPreProcessorWrite new GDAL script
Need to deployfunc azure functionapp publishManual zip deployment

Common Pitfalls

  • Inventing new build commands — Use the established commands above
  • Running pytest directly — Use hatch run test:pytest to get the correct conda env
  • Starting the UI with `npm start` — HASTE uses swa start with Vite dev server
  • Using `python setup.py` — HASTE uses hatch/hatchling, not setuptools
  • Generating GDAL scripts from scratch — Use existing processor methods
All versions