{ "pack_id": "code-composition", "title": "Code composition", "version": "0.2.0", "summary": "A collection of nouns and verbs for composing verified code without rewriting it: the tested code itself, a pinned catalog of 18 prewritten code nodes with typed contracts, three declarative recipes with digests measured with that code, and verbs to verify the code, compose, compile, run and compare recipes, and propose new nodes for review.", "moved_from": { "repository": "https://github.com/ta-amps/kothar", "commit": "6bfee07feb7ed3c7ba9111b0a0678bff5cbf2078" }, "dependencies": [ "checks-of-checks", "decomposition-patterns" ], "boundaries": [ "The pack keeps its tested code as nouns in its code folder. The library never runs that code except in CI tests; workers run it under their own permissions, only from a checkout whose code folder matches the tool card and passed verify-tools. Importing the pack runs nothing.", "Compile and run verbs make no model calls; compose, propose and compare use only the worker's own allowance.", "A proposed node stays a candidate until a different worker or a person reviews it; adding it to the pack's code is the owner's decision.", "Importing the pack writes nothing and enqueues nothing." ], "nouns": [ { "slug": "pack", "category": "noun.skill_pack", "role": "pack", "title": "A collection of nouns and verbs for composing verified code without rewriting it", "value": { "lets_workers": [ "Write a small declarative recipe that wires prewritten, tested code nodes together, instead of writing new code for routine data steps.", "Compile a recipe into a checked graph: unknown nodes, wrong port types, bad parameters, missing wiring and cycles are refused with typed diagnostics before anything runs.", "Run a compiled recipe with no model calls, reuse the cached results of unchanged upstream steps, and prove that the emitted standalone Python gives byte-identical outputs.", "Check that a local copy of the code matches this pack's pins: folder digest, module digests, node digests and built-in tests.", "Compare a baseline recipe with a variant by their receipts, and propose a reviewed new node when the catalog lacks a capability." ], "flow": [ "verify-tools checks a library checkout's code folder against the pins, once per sandbox.", "compose-recipe turns a goal into a recipe candidate that compiles.", "compile-recipe compiles a pinned recipe and records its plan digest.", "run-recipe executes it with pinned inputs and records the receipt.", "compare-runs compares a baseline and a variant by their receipts.", "propose-node, then review-node by a different worker or a person, when no node fits." ], "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "card": { "$pin": "tool.composition-tools" } }, "related_packs": [ { "pack_id": "checks-of-checks", "use": "Validate a proposed node's test cases before anyone relies on them." }, { "pack_id": "decomposition-patterns", "use": "Measure the baseline before changing anything when comparing recipe variants." }, { "pack_id": "tool-discovery", "use": "Trial another composition tool against this one with a comparable trial." } ], "code_as_nouns": "The tested code lives in this pack's code folder as nouns, pinned by the folder digest that the manifest also lists. The library never runs it except in CI tests; a worker runs it under its own permissions, only from a checkout that passed verify-tools. Importing the pack runs nothing." }, "relations": [ [ "requires_noun", "tool.composition-tools" ], [ "requires_noun", "runtime" ], [ "requires_noun", "catalog" ], [ "requires_noun", "method" ], [ "requires_noun", "node.ingest.csv-rows" ], [ "requires_noun", "node.clean.dedupe-by-key" ], [ "requires_noun", "node.clean.impute-numeric" ], [ "requires_noun", "node.clean.winsorize-outliers" ], [ "requires_noun", "node.feature.ratio-column" ], [ "requires_noun", "node.feature.rolling-zscore" ], [ "requires_noun", "node.text.normalize-whitespace" ], [ "requires_noun", "node.text.regex-extract" ], [ "requires_noun", "node.filter.threshold-gate" ], [ "requires_noun", "node.join.keyed-enrich" ], [ "requires_noun", "node.model.linear-risk-score" ], [ "requires_noun", "node.model.keyword-weighted-score" ], [ "requires_noun", "node.validate.schema-contract" ], [ "requires_noun", "node.validate.holdout-split" ], [ "requires_noun", "node.eval.binary-metrics" ], [ "requires_noun", "node.eval.shrinkage-select" ], [ "requires_noun", "node.agg.group-summary" ], [ "requires_noun", "node.format.markdown-report" ], [ "requires_noun", "recipe.ab-candidate-selection" ], [ "requires_noun", "recipe.document-signal-digest" ], [ "requires_noun", "recipe.tabular-anomaly-triage" ], [ "requires_noun", "template.recipe-candidate" ], [ "requires_noun", "template.compile-report" ], [ "requires_noun", "template.run-inputs" ], [ "requires_noun", "template.run-receipt" ], [ "requires_noun", "template.verification-report" ], [ "requires_noun", "template.comparison" ], [ "requires_noun", "template.node-proposal" ], [ "requires_noun", "template.review-notes" ], [ "requires_noun", "example.prefix-reuse" ] ] }, { "slug": "tool.composition-tools", "category": "noun.code_node", "role": "tool_card", "title": "Tool card: code composition tools", "category_reason": "A tool card pins the code's identity, license, interfaces and checks for the verbs that run it.", "value": { "name": "Code composition tools", "source": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs/tree/main/packs/code-composition/code", "tool_license": { "spdx": "MIT", "how_to_determine": "Read pyproject.toml in the code folder and the library's LICENSE." }, "pin": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" } }, "pin_reason": "The code lives in this pack, so it is pinned by content, not by commit. Every digest in this pack was measured on the files that folder.sha256 covers. A code folder with another digest is a different tool until a new pack version pins it and verify-tools passes.", "folder_rule": "folder.sha256 is the library's pack-code digest: SHA-256 of `pack-code-v1` and a NUL byte, then the canonical JSON of the sorted [path, file SHA-256] pairs of every file under the code folder, skipping caches, virtual environments, build output and egg-info. The library build computes it from the files and the pack manifest repeats it, so a pin that no longer matches the code fails make check. To recompute it from a checkout's root: python3 -c \"import sys; sys.path.insert(0, 'scripts'); import build_packs as b; from pathlib import Path; print(b.code_digest(Path('packs/code-composition')))\"", "address_note": "Use a checkout of this library whose code folder matches folder.sha256. If none does, end blocked and say so; do not substitute another source. The folder digest is what must match.", "package_path_rule": "Module names in this pack, such as compiler.py, are relative to the import package that pyproject.toml lists under [tool.hatch.build.targets.wheel] packages.", "requires": { "python": ">=3.12", "dependencies": [ "pydantic>=2.9", "httpx>=0.27" ], "lockfile": "uv.lock in the code folder; install with uv sync --locked --all-groups there.", "tessera_for_integration": { "repository": "https://github.com/ta-amps/tessera-infrastructure-work-and-storage-engine", "commit": "55458514e84eaf1e524637c3bd04916ebb4b3c35", "install": "uv sync --locked --all-extras in that checkout" } }, "uses": [ "Compile a declarative recipe into a checked graph of prewritten nodes (compiler.DeterministicCompiler.compile).", "Emit a standalone Python module for a compiled plan (compiler.DeterministicCompiler.emit_python_from_plan).", "Execute a compiled plan with a sub-graph cache and a SHA-256 receipt (runtime.DeterministicRuntime.execute).", "List, verify and register prewritten nodes in a SQLite node database (registry.NodeDatabase).", "Check one claimed seed task against its pins before running it (seed_worker.execute_seed_task).", "Export the code's own Tessera-shaped seed nouns and tasks as an offline preview document (seed_pack.build_seed_pack)." ], "interfaces": { "python": [ "compiler.DeterministicCompiler.compile", "compiler.DeterministicCompiler.emit_python_from_plan", "runtime.DeterministicRuntime.execute", "registry.NodeDatabase", "seed_worker.execute_seed_task" ], "command_line": "The code-composition console script that pyproject.toml declares under [project.scripts], with subcommands init, nodes, verify-nodes, seed-pack, compile, run, compose and demo.", "make_targets": { "setup": "uv sync --locked --all-groups", "check": "ruff check, ruff format --check, mypy in strict mode and pytest", "demo": "verify all 18 nodes, compile and run the 3 recipes with the Python equivalence check, and show cached prefix reuse", "tessera-integration": "the seed export against Tessera's real models, with TESSERA_DIR set to a prepared Tessera checkout" } }, "checks": [ { "command": "make check demo, in the code folder", "result_at_pin": "pass; pytest reports 41 passed and 2 skipped on Python 3.12.13 and 3.13.13 (the 2 Tessera tests skip without Tessera's environment)" }, { "command": "make tessera-integration TESSERA_DIR=, in the code folder", "result_at_pin": "pass; 2 passed" }, { "command": "make check, in the library", "result_at_pin": "pass; the build recomputes the folder digest from the files, and the code's own tests, run by its CI job, check the runtime, node and recipe pins against the code" } ], "measured": "Measured on October 29, 2026 by the pack author in a library checkout on Linux, with Python 3.12.13 and 3.13.13 giving identical digests. A path-filtered CI job reruns these checks on every change to this pack. This is not independent verification.", "cautions": [ "Run code only from a checkout whose code folder matches folder.sha256 and passed verify-tools. Never execute source code copied out of a noun.", "Node code and emitted Python run in the worker's own Python process; this is not a security sandbox.", "Every subcommand except seed-pack creates or migrates a SQLite file at its --db path, and without --db uses CODE_COMPOSITION_DB or a default path under the current directory; seed-pack opens an existing file read-only. Pass a path inside the task workspace.", "The compose subcommand calls a model endpoint when CODE_COMPOSITION_LLM_BASE_URL is set, and looks up earlier recipes in a Tessera deployment whenever TESSERA_URL is set, even with --offline. The verbs in this pack need neither; leave both unset.", "Seed export provenance reads the library checkout's HEAD only when the code sits at the pinned path; a copy anywhere else must pass --source-commit." ], "install_policy": "This card installs nothing. A worker checks out the library, confirms the code folder's digest and installs its locked dependencies in its own task workspace under its execution policy.", "docs": [ "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs/blob/main/packs/code-composition/README.md", "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs/blob/main/packs/code-composition/code/README.md", "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs/blob/main/packs/code-composition/code/examples/recipes/README.md" ], "used_by": [ { "$verb": "code-composition.verify-tools" }, { "$verb": "code-composition.compose-recipe" }, { "$verb": "code-composition.compile-recipe" }, { "$verb": "code-composition.run-recipe" }, { "$verb": "code-composition.compare-runs" }, { "$verb": "code-composition.propose-node" }, { "$verb": "code-composition.review-node" } ] } }, { "slug": "runtime", "category": "noun.code_node", "role": "runtime_manifest", "title": "Compiler and runtime: entry points, checks and module digests of the pinned code", "category_reason": "Pins the exact compiler and runtime modules that every compile and run verb must use.", "value": { "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" } }, "entry_points": [ "compiler.DeterministicCompiler.compile", "compiler.DeterministicCompiler.emit_python_from_plan", "runtime.DeterministicRuntime.execute" ], "module_sha256": { "compiler.py": "481335073a73015822905bdd5033c72fca6d30571586af06b23fd4356d7fbcd0", "errors.py": "c35453098e6271a0800dda655d8cf1e93f40303417415e538dc00748e5e0a308", "public_limits.py": "a02d48edb97537eca6303e5948e19ff5aec8a30e3031b62038f00270e6c4c9df", "registry.py": "cee27cba94fcef1db9b2c5f9bd0e2f3a4f39a76a409433e2e6756e6a05e95d2d", "runtime.py": "0e4d8895a8e7dc45075249559c87936f47171676d654d34b5c59be546c33a25c", "schemas.py": "63b64f41774bf155d2c26bdcb484aeea733e6677999977931554e74db47b293a" }, "digest_rule": "SHA-256 of each module file's bytes with CRLF line endings normalized to LF. The code's seed_worker module applies the same rule before it runs a seed task, and the code's own tests check these pins in CI.", "compile_checks": [ "Every step names a node in the node database; an unknown node id gets a close-match suggestion (node_not_found).", "Governance lens: the node's source matches its code_sha256, the node carries the code's own verified status tag and no quarantine tag, and its SPDX license is one of Apache-2.0, BSD-3-Clause, CC0-1.0, MIT (node_governance_failed).", "Parameters: unknown names are refused, int refuses booleans, numeric bounds and string choices are enforced, and a required parameter without a default must be set (parameter_constraint_failed).", "Edges: both ports exist, with a suggestion on a typo (port_not_found); source and destination port types are exactly equal (port_type_mismatch); an input port takes at most one edge (duplicate_input_wiring).", "Unwired inputs of root steps, and inputs listed in external_inputs as step.port, become graph entry inputs; an unwired required input on any other step is refused with its compatible upstream outputs (missing_required_input).", "Order: a deterministic Kahn topological sort in declaration order; a cycle is refused with its exact path (cycle_detected).", "Each step gets a Merkle fingerprint of its node digest, resolved parameters, entry ports and upstream fingerprints, so renaming steps does not change it and any upstream change does.", "Warnings, not errors: isolated_step and dangling_transform." ], "runtime_behavior": [ "Zero model calls; every receipt records llm_tokens_at_runtime 0.", "A step's cached output is reused when its fingerprint and input digest match; cached and fresh outputs are both checked against the declared port types.", "Entry inputs are matched by port name, or by step.port when a port name appears on more than one root step; a missing or wrongly typed entry input is refused (execution_input_invalid).", "Receipts carry recipe, plan, node, input and output digests, the executed and cached steps, and a receipt digest.", "With the equivalence check on, the emitted standalone module runs on the same inputs and must give byte-identical step and terminal outputs." ], "trust_note": "Execution is in-process and trusts the verified nodes. It is not a sandbox for unreviewed code." }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "catalog", "category": "noun.skill_pack", "role": "catalog", "title": "Node catalog: 18 prewritten nodes, their signatures and port types", "category_reason": "The catalog is the vocabulary a recipe may use: tool bindings with typed signatures.", "value": { "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" } }, "port_types": { "records": "a list of objects", "table": "an object", "series": "a list of finite numbers", "text": "a string", "json": "an object or a list", "metrics": "an object", "artifact": "a string, such as a rendered report" }, "param_types": { "int": "an integer; booleans are refused", "float": "a number", "str": "a string, optionally limited to listed choices", "bool": "true or false", "str_list": "a list of strings" }, "edge_rule": "An edge connects an output port to an input port of exactly the same port type.", "signature_notation": "node_id(input:type, optional_input:type?) [param:type, param:type=default] -> (output:type) # summary. A parameter shown as name:type= has a default that this pack does not repeat; pass it explicitly. Signature lines print defaults as the code does; the node nouns' parameter lists write whole-number defaults as integers, as Tessera stores them.", "code_digest_rule": "A node's code_sha256 is the SHA-256 of its source after CRLF is normalized to LF, trailing spaces are removed from each line, surrounding blank lines are stripped and one final newline is added (schemas.compute_code_sha256).", "signatures": [ "ingest.csv_rows(raw_csv:text) [delimiter:str=\",\", strip_values:bool=true] -> (rows:records, ingest_stats:metrics) # Parse delimiter-separated text into typed row records with numeric coercion.", "clean.dedupe_by_key(rows:records) [key_field:str, keep:str=\"first\"] -> (rows:records, dedupe_stats:metrics) # Deduplicate row records by a key column while keeping the first or last occurrence.", "clean.impute_numeric(rows:records) [fields:str_list, strategy:str=\"median\", fill_value:float=0.0] -> (rows:records, impute_stats:metrics) # Fill missing numeric fields across records using median, mean, or constant fallback.", "clean.winsorize_outliers(rows:records) [field:str, lower_q:float=0.05, upper_q:float=0.95] -> (rows:records, clamp_stats:metrics) # Clamp extreme numeric values in a field to empirical lower and upper quantiles.", "feature.ratio_column(rows:records) [numerator:str, denominator:str, output_field:str=\"ratio\", epsilon:float=1e-09] -> (rows:records, values:series) # Compute a safe numerator-over-denominator ratio column across row records.", "feature.rolling_zscore(rows:records) [field:str, output_field:str=\"zscore\", window:int=5] -> (rows:records, zscores:series) # Compute trailing-window z-scores over a numeric record field.", "text.normalize_whitespace(raw_text:text) [lowercase:bool=false, collapse_blank_lines:bool=true] -> (clean_text:text, text_stats:metrics) # Collapse horizontal whitespace, trim lines, and optionally lowercase raw text.", "text.regex_extract(clean_text:text) [pattern:str, record_prefix:str=\"doc\"] -> (rows:records, extract_stats:metrics) # Extract structured row records from normalized text via a regular expression.", "filter.threshold_gate(rows:records) [field:str, op:str=\"gte\", threshold:float=0.5] -> (passed:records, rejected:records, gate_stats:metrics) # Partition records into passing and rejected subsets using a numeric threshold rule.", "join.keyed_enrich(left_rows:records, right_rows:records) [key_field:str, how:str=\"left\", right_prefix:str=\"\"] -> (rows:records, join_stats:metrics) # Join primary records with lookup enrichment records on a shared key column.", "model.linear_risk_score(rows:records) [feature_fields:str_list, weights_csv:str=\"1.0\", bias:float=0.0, output_field:str=\"risk_score\"] -> (rows:records, scores:series) # Compute a calibrated logistic risk score from weighted numeric features and bias.", "model.keyword_weighted_score(rows:records) [text_field:str=\"message\", keywords:str_list, scale:float=3.0, output_field:str=\"signal_score\"] -> (rows:records, scores:series) # Score record text fields by case-insensitive keyword occurrences normalized to [0, 1].", "validate.schema_contract(rows:records) [required_fields:str_list, min_rows:int=1, strict:bool=true] -> (rows:records, contract_report:metrics) # Verify minimum row count and required column presence before downstream steps.", "validate.holdout_split(rows:records) [key_field:str, holdout_fraction:float=0.35, salt:str=] -> (train_rows:records, holdout_rows:records, split_stats:metrics) # Deterministically hash-split records into calibration and holdout partitions by key.", "eval.binary_metrics(rows:records) [score_field:str=\"risk_score\", label_field:str=\"label\", threshold:float=0.5] -> (eval_metrics:metrics) # Compute precision, recall, F1, accuracy, and Brier score against binary ground-truth labels.", "eval.shrinkage_select(candidate_a:metrics, candidate_b:metrics) [metric_key:str=\"f1\", count_key:str=\"sample_count\", prior_mean:float=0.5, prior_strength:float=8.0, min_margin:float=0.01] -> (selection:json, winner_metrics:metrics) # Compare two candidate metric bundles using empirical-Bayes shrinkage toward a conservative prior.", "agg.group_summary(rows:records) [group_field:str, value_field:str] -> (summary_table:table, agg_stats:metrics) # Aggregate records by a categorical key into count, sum, mean, and max table rows.", "format.markdown_report(summary_table:table, headline_metrics:metrics, extra_context:json?) [title:str=\"Pipeline Report\", max_rows:int=20] -> (report_md:artifact, digest_line:text) # Render a deterministic Markdown report artifact from a summary table and headline metrics." ], "nodes": [ { "node_id": "ingest.csv_rows", "pin": { "$pin": "node.ingest.csv-rows" } }, { "node_id": "clean.dedupe_by_key", "pin": { "$pin": "node.clean.dedupe-by-key" } }, { "node_id": "clean.impute_numeric", "pin": { "$pin": "node.clean.impute-numeric" } }, { "node_id": "clean.winsorize_outliers", "pin": { "$pin": "node.clean.winsorize-outliers" } }, { "node_id": "feature.ratio_column", "pin": { "$pin": "node.feature.ratio-column" } }, { "node_id": "feature.rolling_zscore", "pin": { "$pin": "node.feature.rolling-zscore" } }, { "node_id": "text.normalize_whitespace", "pin": { "$pin": "node.text.normalize-whitespace" } }, { "node_id": "text.regex_extract", "pin": { "$pin": "node.text.regex-extract" } }, { "node_id": "filter.threshold_gate", "pin": { "$pin": "node.filter.threshold-gate" } }, { "node_id": "join.keyed_enrich", "pin": { "$pin": "node.join.keyed-enrich" } }, { "node_id": "model.linear_risk_score", "pin": { "$pin": "node.model.linear-risk-score" } }, { "node_id": "model.keyword_weighted_score", "pin": { "$pin": "node.model.keyword-weighted-score" } }, { "node_id": "validate.schema_contract", "pin": { "$pin": "node.validate.schema-contract" } }, { "node_id": "validate.holdout_split", "pin": { "$pin": "node.validate.holdout-split" } }, { "node_id": "eval.binary_metrics", "pin": { "$pin": "node.eval.binary-metrics" } }, { "node_id": "eval.shrinkage_select", "pin": { "$pin": "node.eval.shrinkage-select" } }, { "node_id": "agg.group_summary", "pin": { "$pin": "node.agg.group-summary" } }, { "node_id": "format.markdown_report", "pin": { "$pin": "node.format.markdown-report" } } ], "node_categories": { "ingest": [ "ingest.csv_rows" ], "clean": [ "clean.dedupe_by_key", "clean.impute_numeric", "clean.winsorize_outliers" ], "feature": [ "feature.ratio_column", "feature.rolling_zscore" ], "text": [ "text.normalize_whitespace", "text.regex_extract" ], "filter": [ "filter.threshold_gate" ], "join": [ "join.keyed_enrich" ], "model": [ "model.linear_risk_score", "model.keyword_weighted_score" ], "validate": [ "validate.schema_contract", "validate.holdout_split" ], "eval": [ "eval.binary_metrics", "eval.shrinkage_select" ], "agg": [ "agg.group_summary" ], "format": [ "format.markdown_report" ] }, "token_estimate_at_pin": { "signature_chars": 4316, "raw_source_chars": 22476, "signature_tokens_est": 1079, "raw_source_tokens_est": 5619, "method": "The code's own catalog statistics with the pinned code; tokens are estimated as characters divided by 4." } }, "relations": [ [ "requires_noun", "runtime" ], [ "requires_noun", "node.ingest.csv-rows" ], [ "requires_noun", "node.clean.dedupe-by-key" ], [ "requires_noun", "node.clean.impute-numeric" ], [ "requires_noun", "node.clean.winsorize-outliers" ], [ "requires_noun", "node.feature.ratio-column" ], [ "requires_noun", "node.feature.rolling-zscore" ], [ "requires_noun", "node.text.normalize-whitespace" ], [ "requires_noun", "node.text.regex-extract" ], [ "requires_noun", "node.filter.threshold-gate" ], [ "requires_noun", "node.join.keyed-enrich" ], [ "requires_noun", "node.model.linear-risk-score" ], [ "requires_noun", "node.model.keyword-weighted-score" ], [ "requires_noun", "node.validate.schema-contract" ], [ "requires_noun", "node.validate.holdout-split" ], [ "requires_noun", "node.eval.binary-metrics" ], [ "requires_noun", "node.eval.shrinkage-select" ], [ "requires_noun", "node.agg.group-summary" ], [ "requires_noun", "node.format.markdown-report" ] ] }, { "slug": "method", "category": "noun.skill_pack", "role": "method", "title": "How to compose verified code without rewriting it", "category_reason": "A reusable method with its guardrails.", "value": { "principles": [ "Compose instead of rewriting: a recipe names catalog node ids, wires their ports with edges and sets bounded parameters. It contains no code.", "Read signatures, not source: the catalog's one-line signatures are enough to write a recipe.", "Compile before running. The compiler refuses unknown nodes, wrong port types, bad parameters, missing wiring and cycles with a typed error code, the step, the port and often a suggestion.", "Repair from diagnostics: change the step, port or parameter the compiler names. Never work around a refusal by writing code into a recipe or a node.", "Run only pinned, verified code: a checkout whose code folder matches the tool card's folder digest and passed verify-tools. Never execute source code copied out of a noun.", "Runs make no model calls, and every receipt shows it.", "Pin everything: tool folder digest, node digests, recipe digest and input digest. A change to any of them is a new run, not an update to an old receipt.", "Change one thing at a time. A variant that keeps upstream steps unchanged reuses their cached outputs, so the comparison is cheap and its differences are attributable.", "Grow the catalog deliberately. When no node fits, propose one with exact-value tests; a different worker or a person reviews it, and adding it to the pack's code is the owner's decision." ], "repair_codes": { "node_not_found": "Use a catalog node id; the diagnostic suggests the closest one.", "parameter_constraint_failed": "Fix the parameter's name, type, bounds or choice.", "port_not_found": "Use one of the ports the diagnostic lists.", "port_type_mismatch": "Wire a port of exactly the same type, or insert a node that converts it.", "missing_required_input": "Wire one of the compatible upstream outputs the diagnostic lists.", "duplicate_input_wiring": "Keep one edge per input port.", "cycle_detected": "Break the reported cycle path.", "unknown_step": "Make every edge name declared steps.", "duplicate_step_id": "Give every step a unique id.", "invalid_external_input": "Write external inputs as step.port for a declared step and port.", "conflicting_external_input": "Do not list a wired port as an external input.", "empty_recipe": "Declare at least one step.", "node_governance_failed": "Stop: the node fails the governance lens and must not be used.", "execution_input_invalid": "At run time: supply every entry input with its declared port type, using step.port when a port name is ambiguous." } } }, { "slug": "node.ingest.csv-rows", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: ingest.csv_rows", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "ingest.csv_rows", "node_version": "1.0.0", "node_category": "ingest", "summary": "Parse delimiter-separated text into typed row records with numeric coercion.", "signature": "ingest.csv_rows(raw_csv:text) [delimiter:str=\",\", strip_values:bool=true] -> (rows:records, ingest_stats:metrics) # Parse delimiter-separated text into typed row records with numeric coercion.", "inputs": [ { "name": "raw_csv", "port_type": "text", "required": true, "description": "Headered delimiter-separated text payload." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Parsed list of typed dictionary records." }, { "name": "ingest_stats", "port_type": "metrics", "description": "Row and column counts parsed from CSV text." } ], "params": [ { "name": "delimiter", "param_type": "str", "required": false, "default": ",", "choices": [ ",", "\t", "|", ";" ], "description": "Field delimiter character." }, { "name": "strip_values", "param_type": "bool", "required": false, "default": true, "description": "Trim whitespace around cell strings and headers." } ], "function_name": "node_ingest_csv_rows", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "8f6a01cec2e2c7514e0b578b58b2ec4c5b9fbd9786c35cd0d6e4fed6534dcf20", "source_lines": 37 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "coerces_numbers_and_nulls" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection", "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.clean.dedupe-by-key", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: clean.dedupe_by_key", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "clean.dedupe_by_key", "node_version": "1.0.0", "node_category": "clean", "summary": "Deduplicate row records by a key column while keeping the first or last occurrence.", "signature": "clean.dedupe_by_key(rows:records) [key_field:str, keep:str=\"first\"] -> (rows:records, dedupe_stats:metrics) # Deduplicate row records by a key column while keeping the first or last occurrence.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Input row records that may contain duplicate keys." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Deduplicated row records in deterministic order." }, { "name": "dedupe_stats", "port_type": "metrics", "description": "Input, unique, and duplicate removal counts." } ], "params": [ { "name": "key_field", "param_type": "str", "required": true, "description": "Record field used as deduplication key." }, { "name": "keep", "param_type": "str", "required": false, "default": "first", "choices": [ "first", "last" ], "description": "Keep first or last record per duplicate key." } ], "function_name": "node_clean_dedupe_by_key", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "ce12ccb08e0b6aa4e3576dba816f43df875758e68c1be5a49741a1acf5eed74e", "source_lines": 27 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "dedupe_first_and_counts" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection", "document-signal-digest", "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.clean.impute-numeric", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: clean.impute_numeric", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "clean.impute_numeric", "node_version": "1.0.0", "node_category": "clean", "summary": "Fill missing numeric fields across records using median, mean, or constant fallback.", "signature": "clean.impute_numeric(rows:records) [fields:str_list, strategy:str=\"median\", fill_value:float=0.0] -> (rows:records, impute_stats:metrics) # Fill missing numeric fields across records using median, mean, or constant fallback.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Input records with potential null numeric cells." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Records with missing numeric fields imputed." }, { "name": "impute_stats", "port_type": "metrics", "description": "Imputed cell count and field count." } ], "params": [ { "name": "fields", "param_type": "str_list", "required": true, "description": "List of numeric field names to impute." }, { "name": "strategy", "param_type": "str", "required": false, "default": "median", "choices": [ "median", "mean", "constant" ], "description": "Statistic used to compute fill values." }, { "name": "fill_value", "param_type": "float", "required": false, "default": 0, "description": "Fallback constant when strategy is constant or column is all-null." } ], "function_name": "node_clean_impute_numeric", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "558f7cbc0d6428bebea826dd02539328efbd36d0f7c674b2535d9d09a5a50d6f", "source_lines": 40 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "median_imputation" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection", "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.clean.winsorize-outliers", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: clean.winsorize_outliers", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "clean.winsorize_outliers", "node_version": "1.0.0", "node_category": "clean", "summary": "Clamp extreme numeric values in a field to empirical lower and upper quantiles.", "signature": "clean.winsorize_outliers(rows:records) [field:str, lower_q:float=0.05, upper_q:float=0.95] -> (rows:records, clamp_stats:metrics) # Clamp extreme numeric values in a field to empirical lower and upper quantiles.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Input records containing the numeric target field." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Records with target field clamped to quantile bounds." }, { "name": "clamp_stats", "port_type": "metrics", "description": "Clamped cell count plus lower and upper bounds." } ], "params": [ { "name": "field", "param_type": "str", "required": true, "description": "Numeric field name to winsorize." }, { "name": "lower_q", "param_type": "float", "required": false, "default": 0.05, "min_value": 0, "max_value": 0.49, "description": "Lower quantile in [0.0, 0.49]." }, { "name": "upper_q", "param_type": "float", "required": false, "default": 0.95, "min_value": 0.51, "max_value": 1, "description": "Upper quantile in [0.51, 1.0]." } ], "function_name": "node_clean_winsorize_outliers", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "d2c65e712754e091f70d8833e2a36000442204402171336b50938c3258a3343d", "source_lines": 49 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "clamps_high_spike" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.feature.ratio-column", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: feature.ratio_column", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "feature.ratio_column", "node_version": "1.0.0", "node_category": "feature", "summary": "Compute a safe numerator-over-denominator ratio column across row records.", "signature": "feature.ratio_column(rows:records) [numerator:str, denominator:str, output_field:str=\"ratio\", epsilon:float=1e-09] -> (rows:records, values:series) # Compute a safe numerator-over-denominator ratio column across row records.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Input records containing numerator and denominator columns." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Records augmented with the computed ratio field." }, { "name": "values", "port_type": "series", "description": "Ordered numeric ratio series across rows." } ], "params": [ { "name": "numerator", "param_type": "str", "required": true, "description": "Numerator field name." }, { "name": "denominator", "param_type": "str", "required": true, "description": "Denominator field name." }, { "name": "output_field", "param_type": "str", "required": false, "default": "ratio", "description": "Destination field name written onto each record." }, { "name": "epsilon", "param_type": "float", "required": false, "default": 1e-09, "min_value": 1e-12, "max_value": 1, "description": "Zero-division floor applied when denominator magnitude is tiny." } ], "function_name": "node_feature_ratio_column", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "7623a86d7f774a0da83f23dc62413325cbaa4a2a627a2f3838877a03e8e05c15", "source_lines": 20 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "computes_error_rate" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection", "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.feature.rolling-zscore", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: feature.rolling_zscore", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "feature.rolling_zscore", "node_version": "1.0.0", "node_category": "feature", "summary": "Compute trailing-window z-scores over a numeric record field.", "signature": "feature.rolling_zscore(rows:records) [field:str, output_field:str=\"zscore\", window:int=5] -> (rows:records, zscores:series) # Compute trailing-window z-scores over a numeric record field.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Ordered input records containing the numeric target field." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Records augmented with trailing z-score values." }, { "name": "zscores", "port_type": "series", "description": "Ordered numeric z-score series." } ], "params": [ { "name": "field", "param_type": "str", "required": true, "description": "Numeric field name to standardize." }, { "name": "output_field", "param_type": "str", "required": false, "default": "zscore", "description": "Destination z-score field name." }, { "name": "window", "param_type": "int", "required": false, "default": 5, "min_value": 2, "max_value": 500, "description": "Trailing window size (>= 2)." } ], "function_name": "node_feature_rolling_zscore", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "7d78a7bf2559b0abb9dae2a00102a604c0203f064a87ab6e879ad6a196ed90e5", "source_lines": 25 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "trailing_spike_positive_zscore" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.text.normalize-whitespace", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: text.normalize_whitespace", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "text.normalize_whitespace", "node_version": "1.0.0", "node_category": "text", "summary": "Collapse horizontal whitespace, trim lines, and optionally lowercase raw text.", "signature": "text.normalize_whitespace(raw_text:text) [lowercase:bool=false, collapse_blank_lines:bool=true] -> (clean_text:text, text_stats:metrics) # Collapse horizontal whitespace, trim lines, and optionally lowercase raw text.", "inputs": [ { "name": "raw_text", "port_type": "text", "required": true, "description": "Unstructured multi-line text document or log stream." } ], "outputs": [ { "name": "clean_text", "port_type": "text", "description": "Whitespace-normalized text." }, { "name": "text_stats", "port_type": "metrics", "description": "Character, line, and word counts after normalization." } ], "params": [ { "name": "lowercase", "param_type": "bool", "required": false, "default": false, "description": "Convert text to lowercase when true." }, { "name": "collapse_blank_lines", "param_type": "bool", "required": false, "default": true, "description": "Drop empty lines when true." } ], "function_name": "node_text_normalize_whitespace", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "d734197b1bd36e19863b2b32e296c660568c8520e491796f003b5457138afd74", "source_lines": 27 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "collapses_tabs_and_blanks" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "document-signal-digest" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.text.regex-extract", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: text.regex_extract", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "text.regex_extract", "node_version": "1.0.0", "node_category": "text", "summary": "Extract structured row records from normalized text via a regular expression.", "signature": "text.regex_extract(clean_text:text) [pattern:str, record_prefix:str=\"doc\"] -> (rows:records, extract_stats:metrics) # Extract structured row records from normalized text via a regular expression.", "inputs": [ { "name": "clean_text", "port_type": "text", "required": true, "description": "Normalized text input scanned line-by-line or multi-line." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Extracted structured records with named regex groups." }, { "name": "extract_stats", "port_type": "metrics", "description": "Total regex matches extracted." } ], "params": [ { "name": "pattern", "param_type": "str", "required": true, "description": "Regular expression with named capture groups." }, { "name": "record_prefix", "param_type": "str", "required": false, "default": "doc", "description": "Fallback ID prefix when pattern omits doc_id." } ], "function_name": "node_text_regex_extract", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "574f723411a467c47213744ec8dba97674fe042a797bb8fa46db09e1468f3c7c", "source_lines": 29 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "extracts_named_incident_lines" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "document-signal-digest" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.filter.threshold-gate", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: filter.threshold_gate", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "filter.threshold_gate", "node_version": "1.0.0", "node_category": "filter", "summary": "Partition records into passing and rejected subsets using a numeric threshold rule.", "signature": "filter.threshold_gate(rows:records) [field:str, op:str=\"gte\", threshold:float=0.5] -> (passed:records, rejected:records, gate_stats:metrics) # Partition records into passing and rejected subsets using a numeric threshold rule.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Input records evaluated against the numeric threshold." } ], "outputs": [ { "name": "passed", "port_type": "records", "description": "Records satisfying the comparison operator and threshold." }, { "name": "rejected", "port_type": "records", "description": "Records failing the comparison operator and threshold." }, { "name": "gate_stats", "port_type": "metrics", "description": "Counts and pass rate across evaluated records." } ], "params": [ { "name": "field", "param_type": "str", "required": true, "description": "Numeric field compared against threshold." }, { "name": "op", "param_type": "str", "required": false, "default": "gte", "choices": [ "gt", "gte", "lt", "lte", "eq" ], "description": "Comparison operator." }, { "name": "threshold", "param_type": "float", "required": false, "default": 0.5, "description": "Decision threshold value." } ], "function_name": "node_filter_threshold_gate", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "dd4bdce30f000d468f32f9ac9b42ddb4dbebf9cb2264fd3645bf45f3a9971d7a", "source_lines": 35 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "splits_high_risk_records" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "document-signal-digest", "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.join.keyed-enrich", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: join.keyed_enrich", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "join.keyed_enrich", "node_version": "1.0.0", "node_category": "join", "summary": "Join primary records with lookup enrichment records on a shared key column.", "signature": "join.keyed_enrich(left_rows:records, right_rows:records) [key_field:str, how:str=\"left\", right_prefix:str=\"\"] -> (rows:records, join_stats:metrics) # Join primary records with lookup enrichment records on a shared key column.", "inputs": [ { "name": "left_rows", "port_type": "records", "required": true, "description": "Primary left-hand records." }, { "name": "right_rows", "port_type": "records", "required": true, "description": "Lookup enrichment records indexed by key_field." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Joined and enriched records." }, { "name": "join_stats", "port_type": "metrics", "description": "Left, matched, and output record counts." } ], "params": [ { "name": "key_field", "param_type": "str", "required": true, "description": "Shared join key column." }, { "name": "how", "param_type": "str", "required": false, "default": "left", "choices": [ "left", "inner" ], "description": "Join strategy (left keeps unmatched left records; inner drops them)." }, { "name": "right_prefix", "param_type": "str", "required": false, "default": "", "description": "Optional prefix added to non-key right-hand columns." } ], "function_name": "node_join_keyed_enrich", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "407c9086f2cf17d5de483e220a330ffc995187cb0efdf64e55c041b064522072", "source_lines": 40 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "left_joins_owner_metadata" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.model.linear-risk-score", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: model.linear_risk_score", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "model.linear_risk_score", "node_version": "1.0.0", "node_category": "model", "summary": "Compute a calibrated logistic risk score from weighted numeric features and bias.", "signature": "model.linear_risk_score(rows:records) [feature_fields:str_list, weights_csv:str=\"1.0\", bias:float=0.0, output_field:str=\"risk_score\"] -> (rows:records, scores:series) # Compute a calibrated logistic risk score from weighted numeric features and bias.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Feature-engineered input records." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Records augmented with bounded [0, 1] logistic score." }, { "name": "scores", "port_type": "series", "description": "Ordered logistic probability series." } ], "params": [ { "name": "feature_fields", "param_type": "str_list", "required": true, "description": "Ordered list of numeric feature column names." }, { "name": "weights_csv", "param_type": "str", "required": false, "default": "1.0", "description": "Comma-separated float weights aligned to feature_fields." }, { "name": "bias", "param_type": "float", "required": false, "default": 0, "min_value": -20, "max_value": 20, "description": "Additive intercept prior to logistic link." }, { "name": "output_field", "param_type": "str", "required": false, "default": "risk_score", "description": "Destination score column name." } ], "function_name": "node_model_linear_risk_score", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "cdc2934bb2c7d9779ad4d4ce38d63e9b3cfd964488c4ff0a48a53768298fd266", "source_lines": 34 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "zero_logit_is_half" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection", "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.model.keyword-weighted-score", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: model.keyword_weighted_score", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "model.keyword_weighted_score", "node_version": "1.0.0", "node_category": "model", "summary": "Score record text fields by case-insensitive keyword occurrences normalized to [0, 1].", "signature": "model.keyword_weighted_score(rows:records) [text_field:str=\"message\", keywords:str_list, scale:float=3.0, output_field:str=\"signal_score\"] -> (rows:records, scores:series) # Score record text fields by case-insensitive keyword occurrences normalized to [0, 1].", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Records containing a text column to scan." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Records augmented with normalized keyword score and matched terms." }, { "name": "scores", "port_type": "series", "description": "Ordered keyword signal scores in [0.0, 1.0]." } ], "params": [ { "name": "text_field", "param_type": "str", "required": false, "default": "message", "description": "Text column name on each record." }, { "name": "keywords", "param_type": "str_list", "required": true, "description": "Case-insensitive signal terms to match." }, { "name": "scale", "param_type": "float", "required": false, "default": 3, "min_value": 0.5, "max_value": 50, "description": "Hit count denominator for saturation at 1.0." }, { "name": "output_field", "param_type": "str", "required": false, "default": "signal_score", "description": "Destination score column name." } ], "function_name": "node_model_keyword_weighted_score", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "22274b95aad1180c92d79c16e5581eb4bbf421d164d8c22abd95d73bb590dc4b", "source_lines": 20 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "scores_incident_keywords" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "document-signal-digest" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.validate.schema-contract", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: validate.schema_contract", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "validate.schema_contract", "node_version": "1.0.0", "node_category": "validate", "summary": "Verify minimum row count and required column presence before downstream steps.", "signature": "validate.schema_contract(rows:records) [required_fields:str_list, min_rows:int=1, strict:bool=true] -> (rows:records, contract_report:metrics) # Verify minimum row count and required column presence before downstream steps.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Input records checked against structural contract." } ], "outputs": [ { "name": "rows", "port_type": "records", "description": "Validated records containing all required column keys." }, { "name": "contract_report", "port_type": "metrics", "description": "Validation summary counts." } ], "params": [ { "name": "required_fields", "param_type": "str_list", "required": true, "description": "Column keys that must exist on every record." }, { "name": "min_rows", "param_type": "int", "required": false, "default": 1, "min_value": 0, "max_value": 100000, "description": "Minimum acceptable record count." }, { "name": "strict", "param_type": "bool", "required": false, "default": true, "description": "Raise ValueError when contract violations occur." } ], "function_name": "node_validate_schema_contract", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "ce23196d7a1eb6149c5d01da62c52332ab0d428ee8326e3eb764ed7abe13d7c4", "source_lines": 33 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "passes_complete_schema" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.validate.holdout-split", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: validate.holdout_split", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "validate.holdout_split", "node_version": "1.0.0", "node_category": "validate", "summary": "Deterministically hash-split records into calibration and holdout partitions by key.", "signature": "validate.holdout_split(rows:records) [key_field:str, holdout_fraction:float=0.35, salt:str=] -> (train_rows:records, holdout_rows:records, split_stats:metrics) # Deterministically hash-split records into calibration and holdout partitions by key.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Input records partitioned deterministically by SHA-256 hash." } ], "outputs": [ { "name": "train_rows", "port_type": "records", "description": "Calibration partition records." }, { "name": "holdout_rows", "port_type": "records", "description": "Leak-free holdout partition records." }, { "name": "split_stats", "port_type": "metrics", "description": "Partition sizes and empirical holdout ratio." } ], "params": [ { "name": "key_field", "param_type": "str", "required": true, "description": "Entity key hashed so identical keys never straddle train and holdout." }, { "name": "holdout_fraction", "param_type": "float", "required": false, "default": 0.35, "min_value": 0.05, "max_value": 0.95, "description": "Target fraction routed into holdout_rows." }, { "name": "salt", "param_type": "str", "required": false, "default_set_in_code": true, "description": "Hash salt for reproducible partition seeds. The pinned code sets a fixed default string; pass salt explicitly, as the bundled A/B recipe does with ab-eval-v1." } ], "function_name": "node_validate_holdout_split", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "6f2e82304825ed01c41e0bf676f053cee928c1e8ea7085b99c6cd64362e5e7e2", "source_lines": 36 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "deterministic_non_empty_partitions" ], "with_exact_expected_values": 0, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.eval.binary-metrics", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: eval.binary_metrics", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "eval.binary_metrics", "node_version": "1.0.0", "node_category": "eval", "summary": "Compute precision, recall, F1, accuracy, and Brier score against binary ground-truth labels.", "signature": "eval.binary_metrics(rows:records) [score_field:str=\"risk_score\", label_field:str=\"label\", threshold:float=0.5] -> (eval_metrics:metrics) # Compute precision, recall, F1, accuracy, and Brier score against binary ground-truth labels.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Scored records containing continuous predictions and binary 0/1 labels." } ], "outputs": [ { "name": "eval_metrics", "port_type": "metrics", "description": "Classification and calibration metrics on the evaluated split." } ], "params": [ { "name": "score_field", "param_type": "str", "required": false, "default": "risk_score", "description": "Predicted probability field in [0, 1]." }, { "name": "label_field", "param_type": "str", "required": false, "default": "label", "description": "Ground-truth binary label field (1 or 0)." }, { "name": "threshold", "param_type": "float", "required": false, "default": 0.5, "min_value": 0, "max_value": 1, "description": "Classification cutoff applied to score_field." } ], "function_name": "node_eval_binary_metrics", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "2fe1605b34f6b9a739274c476b55707c456cd558a8aeb4001582969397c0cd94", "source_lines": 48 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "perfect_binary_predictions" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.eval.shrinkage-select", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: eval.shrinkage_select", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "eval.shrinkage_select", "node_version": "1.0.0", "node_category": "eval", "summary": "Compare two candidate metric bundles using empirical-Bayes shrinkage toward a conservative prior.", "signature": "eval.shrinkage_select(candidate_a:metrics, candidate_b:metrics) [metric_key:str=\"f1\", count_key:str=\"sample_count\", prior_mean:float=0.5, prior_strength:float=8.0, min_margin:float=0.01] -> (selection:json, winner_metrics:metrics) # Compare two candidate metric bundles using empirical-Bayes shrinkage toward a conservative prior.", "inputs": [ { "name": "candidate_a", "port_type": "metrics", "required": true, "description": "Baseline arm evaluation metrics." }, { "name": "candidate_b", "port_type": "metrics", "required": true, "description": "Challenger arm evaluation metrics." } ], "outputs": [ { "name": "selection", "port_type": "json", "description": "Structured decision record with raw and shrunk scores." }, { "name": "winner_metrics", "port_type": "metrics", "description": "Winning arm metrics augmented with shrunk lift." } ], "params": [ { "name": "metric_key", "param_type": "str", "required": false, "default": "f1", "description": "Metric key maximized during arm comparison." }, { "name": "count_key", "param_type": "str", "required": false, "default": "sample_count", "description": "Sample count key weighting empirical observations against prior_strength." }, { "name": "prior_mean", "param_type": "float", "required": false, "default": 0.5, "min_value": 0, "max_value": 1, "description": "Conservative prior mean for small-sample shrinkage." }, { "name": "prior_strength", "param_type": "float", "required": false, "default": 8, "min_value": 0, "max_value": 1000, "description": "Effective pseudo-sample weight on prior_mean." }, { "name": "min_margin", "param_type": "float", "required": false, "default": 0.01, "min_value": 0, "max_value": 0.5, "description": "Minimum shrunk gain required for candidate_b to beat baseline candidate_a." } ], "function_name": "node_eval_shrinkage_select", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "584854abcc0623604c6c6c29549bf00eb529774178911ce43ebb23700acaedb0", "source_lines": 47 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "promotes_challenger_above_shrunk_margin" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.agg.group-summary", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: agg.group_summary", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "agg.group_summary", "node_version": "1.0.0", "node_category": "agg", "summary": "Aggregate records by a categorical key into count, sum, mean, and max table rows.", "signature": "agg.group_summary(rows:records) [group_field:str, value_field:str] -> (summary_table:table, agg_stats:metrics) # Aggregate records by a categorical key into count, sum, mean, and max table rows.", "inputs": [ { "name": "rows", "port_type": "records", "required": true, "description": "Records grouped by group_field and aggregated over value_field." } ], "outputs": [ { "name": "summary_table", "port_type": "table", "description": "Tabular summary with columns and deterministically ordered rows." }, { "name": "agg_stats", "port_type": "metrics", "description": "Group count and total aggregated records." } ], "params": [ { "name": "group_field", "param_type": "str", "required": true, "description": "Categorical grouping column name." }, { "name": "value_field", "param_type": "str", "required": true, "description": "Numeric value column aggregated per group." } ], "function_name": "node_agg_group_summary", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "f7043f84a8805e035ecfb94590c3a14dbd5fdb93ba053a8b945ea7619dec8da6", "source_lines": 32 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "groups_and_sorts_by_mean_desc" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection", "document-signal-digest", "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "node.format.markdown-report", "category": "noun.code_node", "role": "prewritten_node", "title": "Prewritten node: format.markdown_report", "category_reason": "A prewritten node is a pure Python function with a typed contract, pinned by its source digest.", "value": { "node_id": "format.markdown_report", "node_version": "1.0.0", "node_category": "format", "summary": "Render a deterministic Markdown report artifact from a summary table and headline metrics.", "signature": "format.markdown_report(summary_table:table, headline_metrics:metrics, extra_context:json?) [title:str=\"Pipeline Report\", max_rows:int=20] -> (report_md:artifact, digest_line:text) # Render a deterministic Markdown report artifact from a summary table and headline metrics.", "inputs": [ { "name": "summary_table", "port_type": "table", "required": true, "description": "Aggregated table with columns and row dicts." }, { "name": "headline_metrics", "port_type": "metrics", "required": true, "description": "Key-value pipeline metrics rendered in the report header." }, { "name": "extra_context", "port_type": "json", "required": false, "description": "Optional structured decision or provenance context." } ], "outputs": [ { "name": "report_md", "port_type": "artifact", "description": "Deterministic GitHub-Flavored Markdown report string." }, { "name": "digest_line", "port_type": "text", "description": "Single-line summary suitable for logs or notifications." } ], "params": [ { "name": "title", "param_type": "str", "required": false, "default": "Pipeline Report", "description": "Top-level H1 Markdown heading." }, { "name": "max_rows", "param_type": "int", "required": false, "default": 20, "min_value": 1, "max_value": 200, "description": "Maximum table rows rendered into report_md." } ], "function_name": "node_format_markdown_report", "code": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "folder": { "$code": "code-composition" }, "module": "seed_nodes.py", "code_sha256": "11c195fa0d91473282ab4c974cdcb3071ed65a56ac108fea0787926fb1c4cba6", "source_lines": 31 }, "code_license": "MIT", "self_tests": { "cases": 1, "names": [ "renders_markdown_artifact" ], "with_exact_expected_values": 1, "passed_at_pin": true }, "used_by_recipes": [ "ab-candidate-selection", "document-signal-digest", "tabular-anomaly-triage" ] }, "relations": [ [ "requires_noun", "tool.composition-tools" ] ] }, { "slug": "recipe.ab-candidate-selection", "category": "noun.skill_pack", "role": "recipe", "title": "Recipe: Holdout A/B Candidate Model Selection with Shrinkage", "category_reason": "A declarative recipe binds catalog nodes into a reusable procedure; Tessera has no separate recipe category.", "value": { "recipe": { "edges": [ { "dst_port": "rows", "dst_step": "dedupe_rows", "src_port": "rows", "src_step": "ingest_labeled" }, { "dst_port": "rows", "dst_step": "impute_features", "src_port": "rows", "src_step": "dedupe_rows" }, { "dst_port": "rows", "dst_step": "error_ratio", "src_port": "rows", "src_step": "impute_features" }, { "dst_port": "rows", "dst_step": "holdout_partition", "src_port": "rows", "src_step": "error_ratio" }, { "dst_port": "rows", "dst_step": "score_arm_a", "src_port": "holdout_rows", "src_step": "holdout_partition" }, { "dst_port": "rows", "dst_step": "eval_arm_a", "src_port": "rows", "src_step": "score_arm_a" }, { "dst_port": "rows", "dst_step": "score_arm_b", "src_port": "holdout_rows", "src_step": "holdout_partition" }, { "dst_port": "rows", "dst_step": "eval_arm_b", "src_port": "rows", "src_step": "score_arm_b" }, { "dst_port": "candidate_a", "dst_step": "select_winner", "src_port": "eval_metrics", "src_step": "eval_arm_a" }, { "dst_port": "candidate_b", "dst_step": "select_winner", "src_port": "eval_metrics", "src_step": "eval_arm_b" }, { "dst_port": "rows", "dst_step": "cohort_summary", "src_port": "rows", "src_step": "score_arm_b" }, { "dst_port": "summary_table", "dst_step": "decision_report", "src_port": "summary_table", "src_step": "cohort_summary" }, { "dst_port": "headline_metrics", "dst_step": "decision_report", "src_port": "winner_metrics", "src_step": "select_winner" }, { "dst_port": "extra_context", "dst_step": "decision_report", "src_port": "selection", "src_step": "select_winner" } ], "external_inputs": [], "goal": "Clean labeled records, hash-split a leak-free holdout partition, evaluate two competing linear risk parameterizations in parallel diamond branches, select the winner via empirical-Bayes shrinkage, and render a decision report.", "recipe_id": "ab-candidate-selection", "steps": [ { "description": "Parse labeled historical CSV records.", "node_id": "ingest.csv_rows", "params": { "delimiter": ",", "strip_values": true }, "step_id": "ingest_labeled" }, { "description": "Deduplicate historical cases by case_id.", "node_id": "clean.dedupe_by_key", "params": { "keep": "first", "key_field": "case_id" }, "step_id": "dedupe_rows" }, { "description": "Impute missing numeric features prior to partitioning.", "node_id": "clean.impute_numeric", "params": { "fields": [ "errors", "requests", "latency_ms", "label" ], "fill_value": 0, "strategy": "median" }, "step_id": "impute_features" }, { "description": "Compute normalized error_rate feature.", "node_id": "feature.ratio_column", "params": { "denominator": "requests", "numerator": "errors", "output_field": "error_rate" }, "step_id": "error_ratio" }, { "description": "Split records deterministically into calibration and holdout sets.", "node_id": "validate.holdout_split", "params": { "holdout_fraction": 0.5, "key_field": "case_id", "salt": "ab-eval-v1" }, "step_id": "holdout_partition" }, { "description": "Score holdout rows with single-feature baseline arm A.", "node_id": "model.linear_risk_score", "params": { "bias": -0.8, "feature_fields": [ "error_rate" ], "output_field": "risk_score", "weights_csv": "3.0" }, "step_id": "score_arm_a" }, { "description": "Evaluate baseline arm A on the holdout split.", "node_id": "eval.binary_metrics", "params": { "label_field": "label", "score_field": "risk_score", "threshold": 0.5 }, "step_id": "eval_arm_a" }, { "description": "Score holdout rows with two-feature challenger arm B.", "node_id": "model.linear_risk_score", "params": { "bias": -2.2, "feature_fields": [ "error_rate", "latency_ms" ], "output_field": "risk_score", "weights_csv": "9.0,0.008" }, "step_id": "score_arm_b" }, { "description": "Evaluate challenger arm B on the holdout split.", "node_id": "eval.binary_metrics", "params": { "label_field": "label", "score_field": "risk_score", "threshold": 0.5 }, "step_id": "eval_arm_b" }, { "description": "Select between arm A and arm B using empirical-Bayes shrinkage.", "node_id": "eval.shrinkage_select", "params": { "count_key": "sample_count", "metric_key": "f1", "min_margin": 0.02, "prior_mean": 0.5, "prior_strength": 4 }, "step_id": "select_winner" }, { "description": "Summarize challenger risk distribution across holdout cohorts.", "node_id": "agg.group_summary", "params": { "group_field": "cohort", "value_field": "risk_score" }, "step_id": "cohort_summary" }, { "description": "Render decision artifact with shrunk comparison context.", "node_id": "format.markdown_report", "params": { "max_rows": 15, "title": "A/B Shrinkage Candidate Selection" }, "step_id": "decision_report" } ], "title": "Holdout A/B Candidate Model Selection with Shrinkage" }, "recipe_form": "Whole-number floats are written as integers, as Tessera stores them. The compiler reads both forms the same way, but the recipe and plan digests differ from the code folder file's, so both are listed.", "as_stored_here": { "recipe_sha256": "ddd0dc03c95619ab7dbd40da494d6925554ca7cb5384418b9ca1a2342e1f0c74", "plan_sha256": "be45b452d1cdbea8c072589f641635752e9e6f9f7341e2e46efaeb9efcb9704b", "emitted_python_sha256": "75021a5f098f7ef7dcbce3867eafb0657c44c47ca7c56143b2148bb1c9895e07" }, "digest_rules": { "recipe_sha256": "SHA-256 of the recipe's canonical JSON (sorted keys, no spaces), as the compiler records it.", "sample_inputs_sha256": "SHA-256 of the sample inputs' canonical JSON (sorted keys, no spaces).", "file_sha256": "SHA-256 of the recipe file in the code folder with CRLF normalized to LF; the code's own tests check it in CI." }, "compiled_at_pin": { "steps": 12, "edges": 14, "topological_order": [ "ingest_labeled", "dedupe_rows", "impute_features", "error_ratio", "holdout_partition", "score_arm_a", "eval_arm_a", "score_arm_b", "eval_arm_b", "select_winner", "cohort_summary", "decision_report" ], "entry_inputs": [ "ingest_labeled.raw_csv (text)" ], "terminal_outputs": [ "ingest_labeled.ingest_stats (metrics)", "dedupe_rows.dedupe_stats (metrics)", "impute_features.impute_stats (metrics)", "error_ratio.values (series)", "holdout_partition.train_rows (records)", "holdout_partition.split_stats (metrics)", "score_arm_a.scores (series)", "score_arm_b.scores (series)", "cohort_summary.agg_stats (metrics)", "decision_report.report_md (artifact)", "decision_report.digest_line (text)" ], "warnings": 0, "compile_replay_identical": true }, "nodes_used": [ "agg.group_summary", "clean.dedupe_by_key", "clean.impute_numeric", "eval.binary_metrics", "eval.shrinkage_select", "feature.ratio_column", "format.markdown_report", "ingest.csv_rows", "model.linear_risk_score", "validate.holdout_split" ], "sample_inputs": { "raw_csv": "case_id,cohort,errors,requests,latency_ms,label\nc01,enterprise,18,100,420,1\nc02,enterprise,1,120,45,0\nc03,growth,22,90,510,1\nc04,growth,2,150,55,0\nc05,enterprise,15,80,390,1\nc06,starter,0,200,38,0\nc07,starter,19,85,460,1\nc08,growth,1,140,49,0\nc09,enterprise,25,95,530,1\nc10,starter,2,180,42,0\nc11,enterprise,12,100,480,1\nc12,growth,0,160,41,0\n" }, "sample_inputs_synthetic": true, "sample_inputs_sha256": "b745c14bfdda0a14194ea4af648c74a7fe8516cfb53d175feb9aa09ffdcc0abe", "expected_run": { "conditions": "The recipe as stored here, its sample inputs, a fresh node database with an empty cache and the equivalence check on.", "input_sha256": "621bed2efcf75581d533063941e00237d76da6e05a7a0747b7caedfb8203a649", "output_sha256": "a33da7b5cdb2e7f9fcb292859c11f961feb06ac63b746129499f56e753672d9b", "receipt_sha256": "e13c20258116c8af3ec9b0807e9aee7de58bfa2b98047073cdb078c68a5e476e", "executed_steps": 12, "memo_hits": 0, "python_equivalence_verified": true, "llm_tokens_at_runtime": 0 }, "measured": "Compiled and run twice in fresh in-memory databases with the pinned code on October 29, 2026, on Python 3.12.13 and 3.13.13, with identical digests. The recipe, plan, input, output and receipt digests are the same as before the code lost its former name; only the emitted module digest changed, because its header named it. The plan digests as stored here also match the code's own seed export.", "as_in_the_code_folder": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "path": "packs/code-composition/code/examples/recipes/ab-candidate-selection.json", "file_sha256": "6d2883519d97dd5c56ea747dc86bc2a39e8d815cd6f352409b13fc085725eaab", "recipe_sha256": "8d88b6eabda350f10c5adb4f81072d538f35d072b86bdda12938233853744c4f", "plan_sha256": "7a0f9ea316c2269b525059748866af345c0dcf609062067400bea26b64da2c0d" } }, "relations": [ [ "requires_noun", "runtime" ], [ "requires_noun", "node.agg.group-summary" ], [ "requires_noun", "node.clean.dedupe-by-key" ], [ "requires_noun", "node.clean.impute-numeric" ], [ "requires_noun", "node.eval.binary-metrics" ], [ "requires_noun", "node.eval.shrinkage-select" ], [ "requires_noun", "node.feature.ratio-column" ], [ "requires_noun", "node.format.markdown-report" ], [ "requires_noun", "node.ingest.csv-rows" ], [ "requires_noun", "node.model.linear-risk-score" ], [ "requires_noun", "node.validate.holdout-split" ] ] }, { "slug": "recipe.document-signal-digest", "category": "noun.skill_pack", "role": "recipe", "title": "Recipe: Unstructured Incident Log Signal Digest", "category_reason": "A declarative recipe binds catalog nodes into a reusable procedure; Tessera has no separate recipe category.", "value": { "recipe": { "edges": [ { "dst_port": "clean_text", "dst_step": "extract_entries", "src_port": "clean_text", "src_step": "normalize_notes" }, { "dst_port": "rows", "dst_step": "dedupe_docs", "src_port": "rows", "src_step": "extract_entries" }, { "dst_port": "rows", "dst_step": "score_keywords", "src_port": "rows", "src_step": "dedupe_docs" }, { "dst_port": "rows", "dst_step": "filter_alerts", "src_port": "rows", "src_step": "score_keywords" }, { "dst_port": "rows", "dst_step": "channel_summary", "src_port": "passed", "src_step": "filter_alerts" }, { "dst_port": "summary_table", "dst_step": "digest_report", "src_port": "summary_table", "src_step": "channel_summary" }, { "dst_port": "headline_metrics", "dst_step": "digest_report", "src_port": "gate_stats", "src_step": "filter_alerts" } ], "external_inputs": [], "goal": "Normalize raw multi-line incident notes, extract structured entries via regex, deduplicate revisions, score severity keywords, filter high-signal alerts, and render a channel digest.", "recipe_id": "document-signal-digest", "steps": [ { "description": "Normalize raw log whitespace and strip blank lines.", "node_id": "text.normalize_whitespace", "params": { "collapse_blank_lines": true, "lowercase": false }, "step_id": "normalize_notes" }, { "description": "Parse bracketed incident IDs, channels, and messages.", "node_id": "text.regex_extract", "params": { "pattern": "^\\[(?P[A-Z0-9-]+)\\]\\s+(?P[a-z_]+):\\s+(?P.+)$", "record_prefix": "inc" }, "step_id": "extract_entries" }, { "description": "Retain the latest revision per incident ID.", "node_id": "clean.dedupe_by_key", "params": { "keep": "last", "key_field": "doc_id" }, "step_id": "dedupe_docs" }, { "description": "Score incident urgency terms.", "node_id": "model.keyword_weighted_score", "params": { "keywords": [ "outage", "timeout", "rollback", "degraded", "critical" ], "output_field": "signal_score", "scale": 2, "text_field": "message" }, "step_id": "score_keywords" }, { "description": "Keep high-signal incident entries.", "node_id": "filter.threshold_gate", "params": { "field": "signal_score", "op": "gte", "threshold": 0.5 }, "step_id": "filter_alerts" }, { "description": "Aggregate alert counts and mean severity per channel.", "node_id": "agg.group_summary", "params": { "group_field": "channel", "value_field": "signal_score" }, "step_id": "channel_summary" }, { "description": "Render deterministic Markdown incident digest.", "node_id": "format.markdown_report", "params": { "max_rows": 15, "title": "Document Signal Digest" }, "step_id": "digest_report" } ], "title": "Unstructured Incident Log Signal Digest" }, "recipe_form": "Whole-number floats are written as integers, as Tessera stores them. The compiler reads both forms the same way, but the recipe and plan digests differ from the code folder file's, so both are listed.", "as_stored_here": { "recipe_sha256": "10d432fd071f160a53cfca699d28a4544f8c8c26b873db52e47bdd4638059561", "plan_sha256": "522432d0778c6ead3258efe5d2ab00332d3114e9856893779d40d1a4f09c80a7", "emitted_python_sha256": "ce41ee2fbe44c142374e350472ab853fa95faa0ce8386d37e917c5f5c14c7087" }, "digest_rules": { "recipe_sha256": "SHA-256 of the recipe's canonical JSON (sorted keys, no spaces), as the compiler records it.", "sample_inputs_sha256": "SHA-256 of the sample inputs' canonical JSON (sorted keys, no spaces).", "file_sha256": "SHA-256 of the recipe file in the code folder with CRLF normalized to LF; the code's own tests check it in CI." }, "compiled_at_pin": { "steps": 7, "edges": 7, "topological_order": [ "normalize_notes", "extract_entries", "dedupe_docs", "score_keywords", "filter_alerts", "channel_summary", "digest_report" ], "entry_inputs": [ "normalize_notes.raw_text (text)" ], "terminal_outputs": [ "normalize_notes.text_stats (metrics)", "extract_entries.extract_stats (metrics)", "dedupe_docs.dedupe_stats (metrics)", "score_keywords.scores (series)", "filter_alerts.rejected (records)", "channel_summary.agg_stats (metrics)", "digest_report.report_md (artifact)", "digest_report.digest_line (text)" ], "warnings": 0, "compile_replay_identical": true }, "nodes_used": [ "agg.group_summary", "clean.dedupe_by_key", "filter.threshold_gate", "format.markdown_report", "model.keyword_weighted_score", "text.normalize_whitespace", "text.regex_extract" ], "sample_inputs": { "raw_text": " [INC-101] gateway: Minor cache warm-up completed\n\n [INC-102] payments: Critical timeout spike during checkout\n [INC-102] payments: Critical timeout and degraded upstream outage\n [INC-103] auth: Token refresh healthy\n [INC-104] storage: Emergency rollback after critical latency timeout\n" }, "sample_inputs_synthetic": true, "sample_inputs_sha256": "aa2fa2243389a227989dc2e009aea3d3ae1157f89fb99268927139c494a6f1c5", "expected_run": { "conditions": "The recipe as stored here, its sample inputs, a fresh node database with an empty cache and the equivalence check on.", "input_sha256": "3a80b39d1335d33cf979e15d60fa7834439e2092866ab4cdf261224b16d39574", "output_sha256": "4228906adc03c1b986bc72f4807ccf66f11c770ad933ac55f89584cd6299e338", "receipt_sha256": "649a8a6124145ce7e53b9632079fe2a63b2a63a5555994a8050d8843ccb0ef7e", "executed_steps": 7, "memo_hits": 0, "python_equivalence_verified": true, "llm_tokens_at_runtime": 0 }, "measured": "Compiled and run twice in fresh in-memory databases with the pinned code on October 29, 2026, on Python 3.12.13 and 3.13.13, with identical digests. The recipe, plan, input, output and receipt digests are the same as before the code lost its former name; only the emitted module digest changed, because its header named it. The plan digests as stored here also match the code's own seed export.", "as_in_the_code_folder": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "path": "packs/code-composition/code/examples/recipes/document-signal-digest.json", "file_sha256": "563192f4783c9dbf6e2d03096a974dce19d929386ce66abe3faaa2e18dbdd273", "recipe_sha256": "7c192d58186803f91aff932b85f505fa5b21cb2b71da11276cefdd54b956b989", "plan_sha256": "023b572aadc152a9d281ef87dbea0a560d5508e9064b22fa201c4f99813bda99" } }, "relations": [ [ "requires_noun", "runtime" ], [ "requires_noun", "node.agg.group-summary" ], [ "requires_noun", "node.clean.dedupe-by-key" ], [ "requires_noun", "node.filter.threshold-gate" ], [ "requires_noun", "node.format.markdown-report" ], [ "requires_noun", "node.model.keyword-weighted-score" ], [ "requires_noun", "node.text.normalize-whitespace" ], [ "requires_noun", "node.text.regex-extract" ] ] }, { "slug": "recipe.tabular-anomaly-triage", "category": "noun.skill_pack", "role": "recipe", "title": "Recipe: Tabular Telemetry Anomaly Triage with Owner Enrichment", "category_reason": "A declarative recipe binds catalog nodes into a reusable procedure; Tessera has no separate recipe category.", "value": { "recipe": { "edges": [ { "dst_port": "rows", "dst_step": "check_contract", "src_port": "rows", "src_step": "ingest_events" }, { "dst_port": "rows", "dst_step": "dedupe_events", "src_port": "rows", "src_step": "check_contract" }, { "dst_port": "rows", "dst_step": "impute_metrics", "src_port": "rows", "src_step": "dedupe_events" }, { "dst_port": "rows", "dst_step": "clamp_latency", "src_port": "rows", "src_step": "impute_metrics" }, { "dst_port": "rows", "dst_step": "error_rate", "src_port": "rows", "src_step": "clamp_latency" }, { "dst_port": "rows", "dst_step": "latency_z", "src_port": "rows", "src_step": "error_rate" }, { "dst_port": "rows", "dst_step": "score_risk", "src_port": "rows", "src_step": "latency_z" }, { "dst_port": "rows", "dst_step": "gate_anomalies", "src_port": "rows", "src_step": "score_risk" }, { "dst_port": "left_rows", "dst_step": "enrich_owners", "src_port": "passed", "src_step": "gate_anomalies" }, { "dst_port": "right_rows", "dst_step": "enrich_owners", "src_port": "rows", "src_step": "ingest_owners" }, { "dst_port": "rows", "dst_step": "summarize_teams", "src_port": "rows", "src_step": "enrich_owners" }, { "dst_port": "summary_table", "dst_step": "render_report", "src_port": "summary_table", "src_step": "summarize_teams" }, { "dst_port": "headline_metrics", "dst_step": "render_report", "src_port": "gate_stats", "src_step": "gate_anomalies" } ], "external_inputs": [], "goal": "Parse service telemetry and owner lookup CSVs, enforce schema contracts, clean and standardize latency/error features, gate high-risk anomalies, join owning teams, and emit a Markdown triage report.", "recipe_id": "tabular-anomaly-triage", "steps": [ { "description": "Parse raw operational telemetry CSV.", "node_id": "ingest.csv_rows", "params": { "delimiter": ",", "strip_values": true }, "step_id": "ingest_events" }, { "description": "Verify required telemetry columns before cleaning.", "node_id": "validate.schema_contract", "params": { "min_rows": 2, "required_fields": [ "event_id", "service", "errors", "requests", "latency_ms" ], "strict": true }, "step_id": "check_contract" }, { "description": "Drop duplicate event IDs.", "node_id": "clean.dedupe_by_key", "params": { "keep": "first", "key_field": "event_id" }, "step_id": "dedupe_events" }, { "description": "Impute missing numeric telemetry cells via median.", "node_id": "clean.impute_numeric", "params": { "fields": [ "errors", "requests", "latency_ms" ], "fill_value": 0, "strategy": "median" }, "step_id": "impute_metrics" }, { "description": "Clamp extreme latency spikes to empirical [p05, p95] bounds.", "node_id": "clean.winsorize_outliers", "params": { "field": "latency_ms", "lower_q": 0.05, "upper_q": 0.95 }, "step_id": "clamp_latency" }, { "description": "Compute safe per-window error rate.", "node_id": "feature.ratio_column", "params": { "denominator": "requests", "numerator": "errors", "output_field": "error_rate" }, "step_id": "error_rate" }, { "description": "Standardize trailing latency shifts.", "node_id": "feature.rolling_zscore", "params": { "field": "latency_ms", "output_field": "latency_z", "window": 4 }, "step_id": "latency_z" }, { "description": "Compute calibrated logistic anomaly risk.", "node_id": "model.linear_risk_score", "params": { "bias": -1.1, "feature_fields": [ "error_rate", "latency_z" ], "output_field": "risk_score", "weights_csv": "8.0,1.25" }, "step_id": "score_risk" }, { "description": "Isolate high-risk telemetry windows.", "node_id": "filter.threshold_gate", "params": { "field": "risk_score", "op": "gte", "threshold": 0.5 }, "step_id": "gate_anomalies" }, { "description": "Parse service-to-team ownership lookup CSV.", "node_id": "ingest.csv_rows", "params": { "delimiter": ",", "strip_values": true }, "step_id": "ingest_owners" }, { "description": "Join owning engineering team onto passing anomaly records.", "node_id": "join.keyed_enrich", "params": { "how": "left", "key_field": "service", "right_prefix": "" }, "step_id": "enrich_owners" }, { "description": "Aggregate flagged risk scores per team.", "node_id": "agg.group_summary", "params": { "group_field": "team", "value_field": "risk_score" }, "step_id": "summarize_teams" }, { "description": "Render deterministic Markdown triage report.", "node_id": "format.markdown_report", "params": { "max_rows": 20, "title": "Tabular Anomaly Triage Report" }, "step_id": "render_report" } ], "title": "Tabular Telemetry Anomaly Triage with Owner Enrichment" }, "recipe_form": "Whole-number floats are written as integers, as Tessera stores them. The compiler reads both forms the same way, but the recipe and plan digests differ from the code folder file's, so both are listed.", "as_stored_here": { "recipe_sha256": "0f2cd1a8a4cc97c475495b0751dc3d0fe34da0eac9b362f7045a36f63b41d273", "plan_sha256": "3b44769bcaea94364484c352a42246ab11c92d3a302af691293a35ad24f85839", "emitted_python_sha256": "a4314407dd223b762ccf6fe8e6ce693c6dcaa13482734453f3c9908eb8d8040b" }, "digest_rules": { "recipe_sha256": "SHA-256 of the recipe's canonical JSON (sorted keys, no spaces), as the compiler records it.", "sample_inputs_sha256": "SHA-256 of the sample inputs' canonical JSON (sorted keys, no spaces).", "file_sha256": "SHA-256 of the recipe file in the code folder with CRLF normalized to LF; the code's own tests check it in CI." }, "compiled_at_pin": { "steps": 13, "edges": 13, "topological_order": [ "ingest_events", "check_contract", "dedupe_events", "impute_metrics", "clamp_latency", "error_rate", "latency_z", "score_risk", "gate_anomalies", "ingest_owners", "enrich_owners", "summarize_teams", "render_report" ], "entry_inputs": [ "ingest_events.raw_csv (text)", "ingest_owners.raw_csv (text)" ], "terminal_outputs": [ "ingest_events.ingest_stats (metrics)", "check_contract.contract_report (metrics)", "dedupe_events.dedupe_stats (metrics)", "impute_metrics.impute_stats (metrics)", "clamp_latency.clamp_stats (metrics)", "error_rate.values (series)", "latency_z.zscores (series)", "score_risk.scores (series)", "gate_anomalies.rejected (records)", "ingest_owners.ingest_stats (metrics)", "enrich_owners.join_stats (metrics)", "summarize_teams.agg_stats (metrics)", "render_report.report_md (artifact)", "render_report.digest_line (text)" ], "warnings": 0, "compile_replay_identical": true }, "nodes_used": [ "agg.group_summary", "clean.dedupe_by_key", "clean.impute_numeric", "clean.winsorize_outliers", "feature.ratio_column", "feature.rolling_zscore", "filter.threshold_gate", "format.markdown_report", "ingest.csv_rows", "join.keyed_enrich", "model.linear_risk_score", "validate.schema_contract" ], "sample_inputs": { "ingest_events.raw_csv": "event_id,service,errors,requests,latency_ms\nev1,checkout,1,200,48\nev1,checkout,1,200,48\nev2,checkout,2,210,52\nev3,search,0,300,39\nev4,checkout,28,120,490\nev5,billing,,150,44\nev6,billing,24,100,520\n", "ingest_owners.raw_csv": "service,team\ncheckout,commerce-core\nsearch,discovery\nbilling,ledger-ops\n" }, "sample_inputs_synthetic": true, "sample_inputs_sha256": "5fcdb686acb449fa8f3376339f1be8ee17f2445e498c45c55657a9b0550cea9d", "expected_run": { "conditions": "The recipe as stored here, its sample inputs, a fresh node database with an empty cache and the equivalence check on.", "input_sha256": "5fcdb686acb449fa8f3376339f1be8ee17f2445e498c45c55657a9b0550cea9d", "output_sha256": "ee278b6abd1b375de8e9cdd3153ea208c03ff3a457ecd1429782fefc24fafc59", "receipt_sha256": "16f649df80b269dd86bafe3218e760f14b5d5c52a0e4778f877a6be281dbe489", "executed_steps": 13, "memo_hits": 0, "python_equivalence_verified": true, "llm_tokens_at_runtime": 0 }, "measured": "Compiled and run twice in fresh in-memory databases with the pinned code on October 29, 2026, on Python 3.12.13 and 3.13.13, with identical digests. The recipe, plan, input, output and receipt digests are the same as before the code lost its former name; only the emitted module digest changed, because its header named it. The plan digests as stored here also match the code's own seed export.", "as_in_the_code_folder": { "repository": "https://github.com/ta-amps/seed-packs-library-of-nouns-and-verbs", "path": "packs/code-composition/code/examples/recipes/tabular-anomaly-triage.json", "file_sha256": "69bb5aa2e1beede60f9dc43ba14d63cde518f9517f2ad9d6c792682dacca7c16", "recipe_sha256": "71b6a9b3deea70783e055cf69ad172f907502ec6a8baa9cfb367bcb3cdfa8832", "plan_sha256": "a712747079bfc80bc00871509acabf5d859cc6e4891bbb9078dc4da65fe23e48" } }, "relations": [ [ "requires_noun", "runtime" ], [ "requires_noun", "node.agg.group-summary" ], [ "requires_noun", "node.clean.dedupe-by-key" ], [ "requires_noun", "node.clean.impute-numeric" ], [ "requires_noun", "node.clean.winsorize-outliers" ], [ "requires_noun", "node.feature.ratio-column" ], [ "requires_noun", "node.feature.rolling-zscore" ], [ "requires_noun", "node.filter.threshold-gate" ], [ "requires_noun", "node.format.markdown-report" ], [ "requires_noun", "node.ingest.csv-rows" ], [ "requires_noun", "node.join.keyed-enrich" ], [ "requires_noun", "node.model.linear-risk-score" ], [ "requires_noun", "node.validate.schema-contract" ] ] }, { "slug": "template.recipe-candidate", "category": "noun.skill_pack", "role": "template", "title": "Template: a recipe candidate composed for a goal, with the pinned compiler's verdict", "value": { "describes": "a recipe candidate composed for a goal, with the pinned compiler's verdict", "schema": { "type": "object", "additionalProperties": false, "required": [ "recipe", "tool_code", "compile" ], "properties": { "goal_summary": { "type": "string", "minLength": 1, "maxLength": 600 }, "recipe": { "type": "object", "additionalProperties": false, "required": [ "recipe_id", "title", "goal", "steps" ], "properties": { "recipe_id": { "type": "string", "minLength": 1, "maxLength": 120 }, "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "goal": { "type": "string", "minLength": 1, "maxLength": 1200 }, "steps": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "type": "object", "additionalProperties": false, "required": [ "step_id", "node_id" ], "properties": { "step_id": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$" }, "node_id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$" }, "params": { "type": "object" }, "description": { "type": "string", "maxLength": 500 } } } }, "edges": { "type": "array", "maxItems": 256, "items": { "type": "object", "additionalProperties": false, "required": [ "src_step", "src_port", "dst_step", "dst_port" ], "properties": { "src_step": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$" }, "src_port": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" }, "dst_step": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$" }, "dst_port": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" } } } }, "external_inputs": { "type": "array", "maxItems": 32, "items": { "type": "string", "minLength": 1, "maxLength": 130 } } } }, "tool_code": { "type": "object", "additionalProperties": false, "required": [ "path", "files", "sha256" ], "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 200 }, "files": { "type": "integer", "minimum": 1, "maximum": 10000 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" } } }, "compile": { "type": "object", "additionalProperties": false, "required": [ "valid", "attempts" ], "properties": { "valid": { "type": "boolean" }, "attempts": { "type": "integer", "minimum": 1, "maximum": 6 }, "plan_sha256": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$" }, "error_code": { "type": [ "string", "null" ], "maxLength": 80 }, "error_detail": { "type": [ "string", "null" ], "maxLength": 1000 }, "diagnostics": { "type": "array", "maxItems": 20, "items": { "type": "object" } } } }, "nodes_missing": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 300 } } } }, "rules": [ "The recipe holds no code: only node ids, edges and parameters.", "valid is true only when the pinned compiler accepted the recipe, and then plan_sha256 is set.", "When valid is false, error_code and error_detail come from the compiler's last refusal." ] } }, { "slug": "template.compile-report", "category": "noun.eval_run", "role": "template", "title": "Template: one compilation of a recipe with the pinned compiler: plan digest, order, entry inputs and emitted module digest", "value": { "describes": "one compilation of a recipe with the pinned compiler: plan digest, order, entry inputs and emitted module digest", "schema": { "type": "object", "additionalProperties": false, "required": [ "recipe_ref", "tool_code", "valid", "replay_identical", "model_calls" ], "properties": { "recipe_ref": { "type": "string", "minLength": 1, "maxLength": 300 }, "tool_code": { "type": "object", "additionalProperties": false, "required": [ "path", "files", "sha256" ], "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 200 }, "files": { "type": "integer", "minimum": 1, "maximum": 10000 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" } } }, "valid": { "type": "boolean" }, "recipe_sha256": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$" }, "plan_sha256": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$" }, "expected_plan_sha256": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$" }, "plan_matches_expected": { "type": [ "boolean", "null" ] }, "replay_identical": { "type": "boolean" }, "steps": { "type": "integer", "minimum": 0, "maximum": 64 }, "topological_order": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "entry_inputs": { "type": "array", "maxItems": 32, "items": { "type": "string", "minLength": 1, "maxLength": 160 } }, "terminal_outputs": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 160 } }, "warnings": { "type": "array", "maxItems": 32, "items": { "type": "object", "additionalProperties": false, "required": [ "code", "step_id" ], "properties": { "code": { "type": "string", "minLength": 1, "maxLength": 60 }, "step_id": { "type": "string", "minLength": 1, "maxLength": 64 }, "message": { "type": "string", "maxLength": 500 } } } }, "error_code": { "type": [ "string", "null" ], "maxLength": 80 }, "diagnostics": { "type": "array", "maxItems": 20, "items": { "type": "object" } }, "emitted_python_sha256": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$" }, "emitted_python_ref": { "type": [ "string", "null" ], "maxLength": 300 }, "model_calls": { "type": "integer", "const": 0 } } }, "rules": [ "Compile twice; replay_identical says whether both compilations gave the same plan digest.", "When the recipe noun records an expected plan digest, plan_matches_expected is true or the outcome is blocked.", "model_calls is 0." ] } }, { "slug": "template.run-inputs", "category": "noun.benchmark_suite", "role": "template", "title": "Template: entry inputs for one recipe run, keyed by entry port", "value": { "describes": "entry inputs for one recipe run, keyed by entry port", "schema": { "type": "object", "additionalProperties": false, "required": [ "inputs", "synthetic", "contains_personal_data" ], "properties": { "recipe_id": { "type": "string", "maxLength": 120 }, "inputs": { "type": "object" }, "synthetic": { "type": "boolean" }, "contains_personal_data": { "type": "boolean" }, "source": { "type": "string", "maxLength": 600 } } }, "rules": [ "Keys are entry port names, or step.port when a port name appears on more than one root step.", "Inputs with personal data stay in the requester's scope under the owner's data policy." ] } }, { "slug": "template.run-receipt", "category": "noun.eval_run", "role": "template", "title": "Template: one deterministic run of a compiled recipe: the runtime's receipt, equivalence result and environment", "value": { "describes": "one deterministic run of a compiled recipe: the runtime's receipt, equivalence result and environment", "schema": { "type": "object", "additionalProperties": false, "required": [ "recipe_ref", "tool_code", "plan_sha256", "input_sha256", "output_sha256", "receipt_sha256", "executed_steps", "memo_hits", "llm_tokens_at_runtime", "python_equivalence_verified", "environment" ], "properties": { "recipe_ref": { "type": "string", "minLength": 1, "maxLength": 300 }, "inputs_ref": { "type": [ "string", "null" ], "maxLength": 300 }, "tool_code": { "type": "object", "additionalProperties": false, "required": [ "path", "files", "sha256" ], "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 200 }, "files": { "type": "integer", "minimum": 1, "maximum": 10000 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" } } }, "plan_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "input_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "output_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "receipt_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "executed_steps": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "memo_hits": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "llm_tokens_at_runtime": { "type": "integer", "const": 0 }, "python_equivalence_verified": { "type": "boolean" }, "expected_output_sha256": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$" }, "output_matches_expected": { "type": [ "boolean", "null" ] }, "outputs_ref": { "type": [ "string", "null" ], "maxLength": 300 }, "environment": { "type": "object", "additionalProperties": false, "required": [ "python", "platform" ], "properties": { "python": { "type": "string", "minLength": 1, "maxLength": 40 }, "platform": { "type": "string", "minLength": 1, "maxLength": 120 }, "uv": { "type": "string", "maxLength": 40 } } } } }, "rules": [ "Values come from the runtime's own receipt, unchanged.", "With the recipe noun's synthetic sample inputs in an empty cache, output_sha256 must equal the recipe noun's expected value.", "Terminal outputs can contain input data; keep them in the requester's scope." ] } }, { "slug": "template.verification-report", "category": "noun.eval_run", "role": "template", "title": "Template: a check of one checkout against the tool card's commit, the runtime's module digests and the catalog's nodes", "value": { "describes": "a check of one library checkout's code folder against the tool card's folder digest, the runtime's module digests and the catalog's nodes", "schema": { "type": "object", "additionalProperties": false, "required": [ "tool_code", "code_matches", "working_tree_clean", "module_digests", "nodes", "targets", "environment" ], "properties": { "repository": { "type": "string", "maxLength": 200 }, "library_commit": { "type": "string", "pattern": "^[0-9a-f]{40}$" }, "tool_code": { "type": "object", "additionalProperties": false, "required": [ "path", "files", "sha256" ], "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 200 }, "files": { "type": "integer", "minimum": 1, "maximum": 10000 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" } } }, "code_matches": { "type": "boolean" }, "working_tree_clean": { "type": "boolean" }, "module_digests": { "type": "object", "additionalProperties": false, "required": [ "checked", "matched" ], "properties": { "checked": { "type": "integer", "minimum": 0, "maximum": 32 }, "matched": { "type": "integer", "minimum": 0, "maximum": 32 }, "mismatched": { "type": "array", "maxItems": 32, "items": { "type": "string", "minLength": 1, "maxLength": 120 } } } }, "nodes": { "type": "object", "additionalProperties": false, "required": [ "checked", "digests_matched", "contracts_matched", "self_tests_passed" ], "properties": { "checked": { "type": "integer", "minimum": 0, "maximum": 200 }, "digests_matched": { "type": "integer", "minimum": 0, "maximum": 200 }, "contracts_matched": { "type": "integer", "minimum": 0, "maximum": 200 }, "self_tests_passed": { "type": "integer", "minimum": 0, "maximum": 200 }, "mismatched": { "type": "array", "maxItems": 32, "items": { "type": "string", "minLength": 1, "maxLength": 120 } } } }, "targets": { "type": "array", "minItems": 1, "maxItems": 12, "items": { "type": "object", "additionalProperties": false, "required": [ "target", "result" ], "properties": { "target": { "type": "string", "minLength": 1, "maxLength": 80 }, "result": { "type": "string", "enum": [ "pass", "fail", "expected_failure", "not_run" ] }, "evidence": { "type": "string", "maxLength": 2000 } } } }, "tessera_integration": { "type": [ "object", "null" ], "additionalProperties": false, "properties": { "tessera_commit": { "type": "string", "pattern": "^[0-9a-f]{40}$" }, "result": { "type": "string", "enum": [ "pass", "fail", "not_run" ] }, "evidence": { "type": "string", "maxLength": 2000 } } }, "environment": { "type": "object", "additionalProperties": false, "required": [ "python", "platform" ], "properties": { "python": { "type": "string", "minLength": 1, "maxLength": 40 }, "platform": { "type": "string", "minLength": 1, "maxLength": 120 }, "uv": { "type": "string", "maxLength": 40 } } } } }, "rules": [ "code_matches compares the code folder's digest, computed with the tool card's folder rule, with the tool card's folder.sha256; library_commit records which commit was checked out.", "Module digests use the runtime noun's digest rule; node digests use the catalog's code digest rule." ] } }, { "slug": "template.comparison", "category": "noun.eval_run", "role": "template", "title": "Template: a comparison of a baseline recipe and one variant by their receipts in one shared cache", "value": { "describes": "a comparison of a baseline recipe and one variant by their receipts in one shared cache", "schema": { "type": "object", "additionalProperties": false, "required": [ "baseline_ref", "variant_ref", "tool_code", "changed_steps", "shared_steps", "variant_memo_hits", "variant_executed", "baseline_output_sha256", "variant_output_sha256", "outputs_identical", "equivalence_verified" ], "properties": { "baseline_ref": { "type": "string", "minLength": 1, "maxLength": 300 }, "variant_ref": { "type": "string", "minLength": 1, "maxLength": 300 }, "tool_code": { "type": "object", "additionalProperties": false, "required": [ "path", "files", "sha256" ], "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 200 }, "files": { "type": "integer", "minimum": 1, "maximum": 10000 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" } } }, "changed_steps": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "type": "object", "additionalProperties": false, "required": [ "step_id", "change" ], "properties": { "step_id": { "type": "string", "minLength": 1, "maxLength": 64 }, "change": { "type": "string", "minLength": 1, "maxLength": 300 } } } }, "shared_steps": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "variant_memo_hits": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "variant_executed": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "baseline_output_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "variant_output_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "outputs_identical": { "type": "boolean" }, "equivalence_verified": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "boolean" } }, "finding": { "type": "string", "maxLength": 1200 } } }, "rules": [ "Run the baseline first and the variant second in one fresh cache, so cache hits show reuse.", "shared_steps lists the variant's steps whose sub-graph fingerprints match the baseline's; variant_memo_hits should equal it.", "A difference in outputs is attributed only to the changed steps and the steps downstream of them." ] } }, { "slug": "template.node-proposal", "category": "noun.code_node", "role": "template", "title": "Template: a proposed new prewritten node: contract, source, digest, license and exact-value tests", "value": { "describes": "a proposed new prewritten node: contract, source, digest, license and exact-value tests", "schema": { "type": "object", "additionalProperties": false, "required": [ "node_id", "summary", "inputs", "outputs", "params", "function_name", "source_code", "code_sha256", "spdx_license", "test_cases", "why_needed", "tool_code" ], "properties": { "node_id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$" }, "summary": { "type": "string", "minLength": 1, "maxLength": 300 }, "inputs": { "type": "array", "maxItems": 8, "items": { "type": "object", "additionalProperties": false, "required": [ "name", "port_type", "required", "description" ], "properties": { "name": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" }, "port_type": { "type": "string", "enum": [ "records", "table", "series", "text", "json", "metrics", "artifact" ] }, "required": { "type": "boolean" }, "description": { "type": "string", "minLength": 1, "maxLength": 300 } } } }, "outputs": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "type": "object", "additionalProperties": false, "required": [ "name", "port_type", "description" ], "properties": { "name": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" }, "port_type": { "type": "string", "enum": [ "records", "table", "series", "text", "json", "metrics", "artifact" ] }, "description": { "type": "string", "minLength": 1, "maxLength": 300 } } } }, "params": { "type": "array", "maxItems": 12, "items": { "type": "object", "additionalProperties": false, "required": [ "name", "param_type", "required" ], "properties": { "name": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" }, "param_type": { "type": "string", "enum": [ "int", "float", "str", "bool", "str_list" ] }, "required": { "type": "boolean" }, "default": { "description": "Any JSON value of the parameter's type." }, "min_value": { "type": [ "number", "null" ] }, "max_value": { "type": [ "number", "null" ] }, "choices": { "type": [ "array", "null" ], "maxItems": 32, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }, "description": { "type": "string", "maxLength": 300 } } } }, "function_name": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$" }, "source_code": { "type": "string", "minLength": 1, "maxLength": 20000 }, "code_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "spdx_license": { "type": "string", "enum": [ "Apache-2.0", "BSD-3-Clause", "CC0-1.0", "MIT" ] }, "test_cases": { "type": "array", "minItems": 2, "maxItems": 12, "items": { "type": "object", "additionalProperties": false, "required": [ "name", "inputs" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "inputs": { "type": "object" }, "params": { "type": "object" }, "expected": { "type": "object" }, "expected_ports": { "type": "array", "maxItems": 8, "items": { "type": "string", "minLength": 1, "maxLength": 64 } } } } }, "why_needed": { "type": "string", "minLength": 1, "maxLength": 1200 }, "recipes_unblocked": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 300 } }, "tool_code": { "type": "object", "additionalProperties": false, "required": [ "path", "files", "sha256" ], "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 200 }, "files": { "type": "integer", "minimum": 1, "maximum": 10000 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" } } }, "local_tests": { "type": "object", "additionalProperties": false, "required": [ "passed", "failed" ], "properties": { "passed": { "type": "integer", "minimum": 0 }, "failed": { "type": "integer", "minimum": 0 } } } } }, "rules": [ "The author never adds the code's verified status tag; only the library's own review can.", "code_sha256 recomputes from source_code with the catalog's code digest rule.", "At least one test case has exact expected output values.", "The function is pure: no network, files, processes, clocks or randomness." ] } }, { "slug": "template.review-notes", "category": "noun.eval_run", "role": "template", "title": "Template: a reviewer's decision on one node proposal, with the checks the reviewer reran", "value": { "describes": "a reviewer's decision on one node proposal, with the checks the reviewer reran", "schema": { "type": "object", "additionalProperties": false, "required": [ "subject_ref", "decision", "findings", "checks_rerun", "reviewer_is_author" ], "properties": { "subject_ref": { "type": "string", "minLength": 1, "maxLength": 300 }, "decision": { "type": "string", "enum": [ "accept", "revise", "reject" ] }, "findings": { "type": "array", "maxItems": 20, "items": { "type": "object", "additionalProperties": false, "required": [ "finding", "severity" ], "properties": { "finding": { "type": "string", "minLength": 1, "maxLength": 600 }, "severity": { "type": "string", "enum": [ "blocking", "minor" ] } } } }, "checks_rerun": { "type": "object", "additionalProperties": false, "required": [ "digest_recomputed", "tests_passed", "tests_failed" ], "properties": { "digest_recomputed": { "type": "boolean" }, "tests_passed": { "type": "integer", "minimum": 0 }, "tests_failed": { "type": "integer", "minimum": 0 } } }, "reviewer_is_author": { "type": "boolean", "const": false }, "notes": { "type": "string", "maxLength": 2000 } } }, "rules": [ "The reviewer is not the proposal's author.", "accept means the owner may add the node to the pack's code through the library's own change review; these notes change nothing by themselves." ] } }, { "slug": "example.prefix-reuse", "category": "noun.eval_run", "role": "example", "title": "SYNTHETIC worked example: a variant that reuses the 7 unchanged upstream steps", "synthetic": true, "value": { "conforms_to": { "$pin": "template.comparison" }, "instance": { "baseline_ref": { "$key": "recipe.ab-candidate-selection" }, "variant_ref": "The baseline with score_arm_b changed, as in the code's demo", "tool_code": { "$code": "code-composition" }, "changed_steps": [ { "step_id": "score_arm_b", "change": "weights_csv 11.5,0.012 and bias -2.5" } ], "shared_steps": [ "ingest_labeled", "dedupe_rows", "impute_features", "error_ratio", "holdout_partition", "score_arm_a", "eval_arm_a" ], "variant_memo_hits": [ "ingest_labeled", "dedupe_rows", "impute_features", "error_ratio", "holdout_partition", "score_arm_a", "eval_arm_a" ], "variant_executed": [ "score_arm_b", "eval_arm_b", "select_winner", "cohort_summary", "decision_report" ], "baseline_output_sha256": "a33da7b5cdb2e7f9fcb292859c11f961feb06ac63b746129499f56e753672d9b", "variant_output_sha256": "2315a0be4b7846f172750d469ab7a55203d4f4adc1f47e1947cb55b5e211fdb1", "outputs_identical": false, "equivalence_verified": [ true, true ], "finding": "The variant reused the 7 upstream steps it shares with the baseline and executed only the changed arm and the 4 steps downstream of it." }, "reading": "Measured with the pinned code and the recipe's synthetic sample inputs, baseline first and variant second in one fresh cache. The inputs are synthetic, so the numbers show reuse, not model quality." }, "relations": [ [ "requires_noun", "recipe.ab-candidate-selection" ] ] } ], "verbs": [ { "slug": "verify-tools", "kind": "verb.verify_gate", "title": "Verify the pinned code in a library checkout", "claimant": "agent", "model_use": "none", "summary": "Check the code folder of a fresh library checkout against this pack's pins and run the code's own checks, before any compile or run verb relies on it.", "outcome": "A verification report: folder digest, module digests, node digests and tests, and each check with its result.", "ready_outcome": "tools_verified", "pinned": [ "tool.composition-tools", "runtime", "catalog" ], "params": { "run_tessera_integration": { "schema": { "type": "boolean" }, "default": false, "description": "Also run the code's Tessera integration check with Tessera at the commit the tool card names." } }, "produces": [ { "name": "verification_report", "template": "template.verification-report" } ], "steps": [ "Verify the pins and check out the library into the task workspace.", "Compute the code folder's digest with the tool card's folder rule; require it to equal folder.sha256 and the working tree to be clean, otherwise end blocked.", "Install the locked dependencies with uv sync --locked --all-groups in the code folder.", "Hash each module the runtime noun lists with its digest rule and compare every digest with its pin.", "Load the packaged node catalog in an in-memory database. Compare each node's code_sha256, ports and parameters with its node noun, comparing numbers by value and a parameter marked default_set_in_code by name and type only, then run every node's built-in tests.", "Run make check and make demo in the code folder, and record each result with the last lines of its output.", "When run_tessera_integration is true, prepare Tessera at the tool card's Tessera commit with uv sync --locked --all-extras and run make tessera-integration in the code folder with TESSERA_DIR set to that checkout." ], "acceptance": [ { "id": "report-matches-template", "check": "The verification report validates against template.verification-report's schema.", "method": "deterministic" }, { "id": "code-matches", "check": "code_matches and working_tree_clean are both true.", "method": "deterministic" }, { "id": "modules-match", "check": "Every module digest matches the runtime noun.", "method": "deterministic" }, { "id": "nodes-match", "check": "All 18 node digests and contracts match their node nouns and every built-in test passes.", "method": "deterministic" }, { "id": "checks-pass", "check": "make check and make demo in the code folder each report pass.", "method": "deterministic" } ], "bounds": { "max_elapsed_seconds": 2400 }, "network": [ "sandbox_packages", "Clone the library from GitHub and install the code's locked packages from PyPI into the task sandbox; with run_tessera_integration, also clone Tessera at its pinned commit. No other hosts." ], "capabilities": [ "read permitted noun versions", "an isolated sandbox with git, Python 3.12 or newer and uv, and no credentials", "write candidate nouns in the requester's scope" ], "ready_requires": [ "checks" ] }, { "slug": "compose-recipe", "kind": "verb.solve_draft", "title": "Compose a recipe for a goal", "claimant": "agent", "summary": "Turn a goal into a declarative recipe that uses only catalog nodes, repairing it from the compiler's diagnostics until the pinned compiler accepts it.", "outcome": "A recipe candidate that compiles with the pinned code, or no_change that names the missing capabilities.", "ready_outcome": "recipe_ready", "pinned": [ "catalog", "method", "template.recipe-candidate" ], "slots": [ { "name": "goal", "category": "noun.seed_hypothesis", "description": "Pin of the goal or brief: what the pipeline must produce from which inputs." }, { "name": "example_inputs", "category": "noun.benchmark_suite", "description": "Optional pin of example inputs shaped by template.run-inputs, to check entry port types.", "required": false }, { "name": "verification", "category": "noun.eval_run", "description": "Pin of a verify-tools report for the checkout this worker uses." } ], "params": { "max_compiles": { "schema": { "type": "integer", "minimum": 1, "maximum": 6 }, "default": 4, "description": "Compile attempts before ending without a recipe." } }, "produces": [ { "name": "recipe_candidate", "template": "template.recipe-candidate" } ], "steps": [ "Verify the pins and read the goal, the catalog's signatures and the method.", "Write the recipe as JSON with only catalog node ids, their port names and parameters within their bounds. Write no code.", "Compile it with the verified checkout's compiler and record the verdict. On a refusal, change the step, port or parameter the diagnostics name and compile again, up to max_compiles times.", "When no catalog node fits a needed step, end with no_change, list the missing capability in nodes_missing and propose a propose-node verb instead of writing code." ], "acceptance": [ { "id": "candidate-matches-template", "check": "The recipe candidate validates against template.recipe-candidate's schema.", "method": "deterministic" }, { "id": "catalog-only", "check": "Every node_id in the recipe appears in the catalog.", "method": "deterministic" }, { "id": "compiles", "check": "compile.valid is true and plan_sha256 is set by the pinned compiler.", "method": "deterministic" }, { "id": "fits-goal", "check": "The recipe's terminal outputs answer the goal.", "method": "judgment" } ], "bounds": { "max_elapsed_seconds": 1800 }, "capabilities": [ "read permitted noun versions", "a library checkout whose code folder matches the tool card and passed verify-tools", "write candidate nouns in the requester's scope" ], "follows": [ "code-composition.verify-tools" ], "ready_requires": [ "checks" ] }, { "slug": "compile-recipe", "kind": "verb.compile_dag", "title": "Compile a recipe into a checked graph", "claimant": "agent", "model_use": "none", "summary": "Compile one pinned recipe twice with the pinned compiler and record its plan digest, order, entry inputs and the digest of the emitted standalone Python module.", "outcome": "A compile report whose plan digest matches the recipe noun's expected digest whenever it records one.", "ready_outcome": "compiled", "pinned": [ "runtime", "template.compile-report" ], "slots": [ { "name": "recipe", "category": "noun.skill_pack", "description": "Pin of a recipe noun from this pack or of a recipe candidate." }, { "name": "verification", "category": "noun.eval_run", "description": "Pin of a verify-tools report for the checkout this worker uses." } ], "params": { "emit_python": { "schema": { "type": "boolean" }, "default": true, "description": "Also emit the standalone Python module, store it as a blob and record its digest." } }, "produces": [ { "name": "compile_report", "template": "template.compile-report" } ], "steps": [ "Verify the pins and confirm that the verification report is for the tool card's folder digest and passed.", "Read the recipe JSON exactly as the noun stores it and compile it twice with the verified checkout's compiler.", "Record the plan digest, topological order, entry inputs, terminal outputs and warnings, or the error code and diagnostics.", "When the recipe noun records an expected plan digest, require an exact match; a mismatch ends blocked.", "When emit_python is true, emit the standalone module, store it as a blob in the requester's scope and record its SHA-256." ], "acceptance": [ { "id": "report-matches-template", "check": "The compile report validates against template.compile-report's schema.", "method": "deterministic" }, { "id": "replay-identical", "check": "Both compilations gave the same plan digest.", "method": "deterministic" }, { "id": "expected-plan", "check": "plan_matches_expected is true whenever the recipe noun records an expected plan digest.", "method": "deterministic" }, { "id": "no-model", "check": "model_calls is 0.", "method": "deterministic" } ], "bounds": { "max_elapsed_seconds": 600 }, "capabilities": [ "read permitted noun versions", "a library checkout whose code folder matches the tool card and passed verify-tools", "store blobs in the requester's scope", "write candidate nouns in the requester's scope" ], "follows": [ "code-composition.verify-tools", "code-composition.compose-recipe" ], "ready_requires": [ "checks" ] }, { "slug": "run-recipe", "kind": "verb.compile_dag", "title": "Run a compiled recipe", "claimant": "agent", "model_use": "none", "summary": "Execute one pinned recipe with pinned inputs on the verified runtime, with no model calls, and check that the emitted standalone Python gives byte-identical outputs.", "outcome": "A run receipt; with the recipe noun's synthetic sample inputs, its output digest equals the recorded one.", "ready_outcome": "run_complete", "pinned": [ "runtime", "template.run-receipt" ], "slots": [ { "name": "recipe", "category": "noun.skill_pack", "description": "Pin of a recipe noun from this pack or of a recipe candidate." }, { "name": "inputs", "category": "noun.benchmark_suite", "description": "Optional pin of entry inputs shaped by template.run-inputs. Without it the run uses the recipe noun's synthetic sample inputs.", "required": false }, { "name": "verification", "category": "noun.eval_run", "description": "Pin of a verify-tools report for the checkout this worker uses." } ], "params": { "use_cache": { "schema": { "type": "boolean" }, "default": true, "description": "Reuse cached step outputs in the run's own node database." } }, "produces": [ { "name": "run_receipt", "template": "template.run-receipt" } ], "steps": [ "Verify the pins and confirm that the verification report is for the tool card's folder digest and passed.", "Compile the recipe as stored and require the plan digest the recipe noun records, when it records one.", "Execute with the pinned inputs, or the recipe noun's sample inputs, in a node database inside the task workspace with the Python equivalence check on.", "Copy the runtime's receipt fields unchanged into the run receipt and store the terminal outputs as a blob in the requester's scope.", "With the sample inputs and an empty cache, require output_sha256 to equal the recipe noun's expected value; a mismatch ends blocked." ], "acceptance": [ { "id": "receipt-matches-template", "check": "The run receipt validates against template.run-receipt's schema.", "method": "deterministic" }, { "id": "no-model", "check": "llm_tokens_at_runtime is 0.", "method": "deterministic" }, { "id": "equivalent", "check": "python_equivalence_verified is true.", "method": "deterministic" }, { "id": "expected-output", "check": "output_matches_expected is true whenever the recipe noun's sample inputs were used in an empty cache.", "method": "deterministic" } ], "bounds": { "max_elapsed_seconds": 900 }, "capabilities": [ "read permitted noun versions", "a library checkout whose code folder matches the tool card and passed verify-tools", "store blobs in the requester's scope", "write candidate nouns in the requester's scope" ], "follows": [ "code-composition.compile-recipe" ], "ready_requires": [ "checks" ] }, { "slug": "compare-runs", "kind": "verb.benchmark_harness", "title": "Compare a baseline recipe with a variant", "claimant": "agent", "summary": "Run a baseline recipe and one variant in one fresh cache, list the steps the variant reused, and attribute any output difference to the steps that changed.", "outcome": "A comparison with shared steps, cache hits, both output digests and a finding the receipts support.", "ready_outcome": "comparison_ready", "pinned": [ "method", "template.comparison", "decomposition-patterns:pattern.baseline-then-variant" ], "slots": [ { "name": "baseline", "category": "noun.skill_pack", "description": "Pin of the baseline recipe." }, { "name": "variant", "category": "noun.skill_pack", "description": "Pin of the variant recipe, ideally with one change." }, { "name": "inputs", "category": "noun.benchmark_suite", "description": "Optional pin of shared entry inputs shaped by template.run-inputs; without it both use the baseline noun's sample inputs.", "required": false }, { "name": "verification", "category": "noun.eval_run", "description": "Pin of a verify-tools report for the checkout this worker uses." } ], "produces": [ { "name": "comparison", "template": "template.comparison" } ], "steps": [ "Verify the pins and confirm that the verification report is for the tool card's folder digest and passed.", "List the steps whose node, parameters or wiring differ between the two recipes.", "Compile both and list the variant's steps whose sub-graph fingerprints match the baseline's.", "Run the baseline first and the variant second, with the same inputs, in one fresh node database inside the task workspace, with the equivalence check on.", "Compare the output digests and attribute each difference only to changed steps and the steps downstream of them." ], "acceptance": [ { "id": "comparison-matches-template", "check": "The comparison validates against template.comparison's schema.", "method": "deterministic" }, { "id": "reuse-matches-fingerprints", "check": "variant_memo_hits equals shared_steps.", "method": "deterministic" }, { "id": "both-equivalent", "check": "Both entries of equivalence_verified are true.", "method": "deterministic" }, { "id": "finding-supported", "check": "The finding follows from the receipts and the listed changes.", "method": "judgment" } ], "bounds": { "max_elapsed_seconds": 1800, "max_runs": 2 }, "capabilities": [ "read permitted noun versions", "a library checkout whose code folder matches the tool card and passed verify-tools", "write candidate nouns in the requester's scope" ], "follows": [ "code-composition.run-recipe" ], "ready_requires": [ "checks" ] }, { "slug": "propose-node", "kind": "verb.solve_draft", "title": "Propose a new prewritten node", "claimant": "agent", "summary": "When no catalog node fits a needed step, write a candidate node with a typed contract, pure source and exact-value tests, and test it locally without adding it to the catalog.", "outcome": "A node proposal for review, or no_change when an existing node or a recipe change already covers the need.", "ready_outcome": "proposal_ready", "pinned": [ "catalog", "method", "template.node-proposal", "checks-of-checks:method" ], "slots": [ { "name": "need", "category": "noun.seed_hypothesis", "description": "Pin of the goal or brief that needs the missing capability." }, { "name": "recipe_candidate", "category": "noun.skill_pack", "description": "Optional pin of the recipe candidate that named the missing capability.", "required": false }, { "name": "verification", "category": "noun.eval_run", "description": "Pin of a verify-tools report for the checkout this worker uses." } ], "produces": [ { "name": "node_proposal", "template": "template.node-proposal" } ], "steps": [ "Verify the pins and confirm that no catalog node, or small recipe change, already covers the need.", "Write the contract with the catalog's port and parameter types, and a pure function in the style of the catalog's nodes, with no network, files, processes, clocks or randomness.", "Write at least two test cases, at least one with exact expected output values, following the checks-of-checks method for good and bad examples.", "Compute code_sha256 with the catalog's code digest rule and run the tests by registering the candidate in an in-memory node database of the verified checkout. Never change the checkout's own catalog files.", "Never mark the proposal verified, and propose a review-node verb for a different worker or a person." ], "acceptance": [ { "id": "proposal-matches-template", "check": "The node proposal validates against template.node-proposal's schema.", "method": "deterministic" }, { "id": "new-id", "check": "node_id does not appear in the catalog.", "method": "deterministic" }, { "id": "digest-recomputes", "check": "code_sha256 recomputes from source_code with the catalog's code digest rule.", "method": "deterministic" }, { "id": "exact-test", "check": "At least one test case has exact expected values, and local_tests.failed is 0.", "method": "deterministic" }, { "id": "reusable", "check": "The node is general enough to reuse beyond one recipe.", "method": "judgment" } ], "bounds": { "max_elapsed_seconds": 2400 }, "capabilities": [ "read permitted noun versions", "a library checkout whose code folder matches the tool card and passed verify-tools", "write candidate nouns in the requester's scope" ], "follows": [ "code-composition.compose-recipe" ], "ready_requires": [ "checks" ] }, { "slug": "review-node", "kind": "verb.verify_gate", "title": "Review a node proposal", "claimant": "agent_or_human", "review": "distinct_reviewer", "summary": "A worker or person other than the author rechecks a node proposal's digest, tests, purity and license and decides accept, revise or reject.", "outcome": "Review notes with the decision and the checks the reviewer reran.", "ready_outcome": "review_ready", "pinned": [ "method", "template.review-notes", "template.node-proposal" ], "slots": [ { "name": "proposal", "category": "noun.code_node", "description": "Pin of the node proposal to review." }, { "name": "verification", "category": "noun.eval_run", "description": "Pin of a verify-tools report for the checkout this worker uses." } ], "produces": [ { "name": "review_notes", "template": "template.review-notes" } ], "steps": [ "Verify the pins and confirm that you are not the proposal's author.", "Recompute code_sha256 from source_code and rerun every test case by registering the candidate in an in-memory node database of the verified checkout.", "Read the source for purity, input mutation, type safety and license, and check that the contract matches what the code returns.", "Decide accept, revise or reject and give each blocking finding. Adding an accepted node to the pack's code is the owner's separate decision through the library's own review." ], "acceptance": [ { "id": "notes-match-template", "check": "The review notes validate against template.review-notes' schema.", "method": "deterministic" }, { "id": "independent", "check": "reviewer_is_author is false.", "method": "deterministic" }, { "id": "rechecked", "check": "checks_rerun.digest_recomputed is true and the test counts are recorded.", "method": "deterministic" }, { "id": "decision-justified", "check": "The decision follows from the findings.", "method": "judgment" } ], "bounds": { "max_elapsed_seconds": 2400 }, "capabilities": [ "read permitted noun versions", "a library checkout whose code folder matches the tool card and passed verify-tools", "write candidate nouns in the requester's scope" ], "follows": [ "code-composition.propose-node" ], "ready_requires": [ "checks" ] } ] }