# Code composition ## What this pack lets workers do A collection of nouns and verbs for composing verified code without rewriting it. Instead of writing new code for routine data steps, a worker writes a small declarative recipe that wires prewritten, tested code nodes together. A compiler checks the recipe before anything runs. The runtime then executes it with no model calls, reuses cached results of unchanged steps and proves that the emitted standalone Python gives byte-identical outputs. The tested code is part of the pack, as nouns, in [code/](code/README.md). The tool card pins that folder by the digest the manifest also lists; the build recomputes it from the files, and the code's own tests check the module, node and recipe pins in CI. The library never runs the code except in CI tests; workers run it under their own permissions. Importing runs nothing. ## Nouns | Noun | What it holds | | --- | --- | | Tool card | The code folder's path and digest, license, requirements, interfaces, checks and cautions | | Compiler and runtime | Entry points, compile checks, runtime behavior and the SHA-256 of the six modules every compile and run uses | | Node catalog | Signatures of the 18 nodes, port and parameter types, the edge rule and the code digest rule | | Prewritten nodes (18) | One per node: typed ports and parameters, source digest, license, built-in tests and the recipes that use it | | Recipes (3) | Telemetry anomaly triage, incident log digest and A/B candidate selection, with plan, output and receipt digests | | Method | How to compose without rewriting code, and how to repair each compiler refusal | | Templates (8) | Recipe candidate, compile report, run inputs, run receipt, verification report, comparison, node proposal and review notes | | Worked example | SYNTHETIC: a variant that changes one step reuses the 7 unchanged upstream steps from the cache | ## Verbs | Verb | Who | What happens | | --- | --- | --- | | verify-tools | agent | Checks the code folder of a fresh library checkout: folder and module digests, node tests and the code's own checks | | compose-recipe | agent | Turns a goal into a recipe the pinned compiler accepts, repairing it from the diagnostics | | compile-recipe | agent | Compiles a recipe twice and records its plan digest and emitted module; deterministic | | run-recipe | agent | Runs it with pinned inputs and records the receipt; no model calls | | compare-runs | agent | Runs a baseline and a variant in one cache and ties output differences to the changed steps | | propose-node | agent | Writes a tested node candidate when no catalog node fits | | review-node | a different agent or a person | Rechecks a proposal and decides accept, revise or reject | Each verb can also end with `no_change`, `unknown` or `blocked`, and can propose follow-up verbs. compare-runs follows the baseline-then-variant pattern from [decomposition patterns](../decomposition-patterns/README.md), and propose-node uses the [checks of checks](../checks-of-checks/README.md) method for its tests. ## How to use it Run verify-tools first in each sandbox; every other verb takes its report as a pin. Write the nouns in [nouns.json](nouns.json) create-only with a key scoped to your team's surface, then fill a template from [verbs.json](verbs.json) with `scripts/build_packs.py --instantiate