Skip to content

Executor

sarr-io edited this page Jun 14, 2026 · 11 revisions

Executor ↯

Zinc advances one fragment at a time.

◌ Contract

prepare(source, args) -> assembly_fragment
advance(assembly_fragment) -> assembly_fragment

advance returns a new assembly fragment when it moves. If it cannot move, it errors.

✦ Prepare

prepare stores source and args as an assembly fragment.

target: zinc.assembly
request:
  source: examples/answer.circuitry.yaml
  args: [question="what is zinc?"]
result:
  source: examples/answer.circuitry.yaml

▣ Advance

advance loads the assembly fragment and walks Circuitry uses.

assembly fragment
      │
      ▼
confirm shape
      │
      ▼
for each use ─► package request bytes ─► head lookup
                                      │
                                      ├─ hit: apply stored result
                                      │
                                      └─ miss: run package software
                                               │
                                               ▼
                                         store fragment
                                         move head
                                         apply outputs

⟡ Package request

A package request is YAML bytes:

run: openai-responses.software.responses
part: answer
part_yaml: |
  does: |
    Answer in one short sentence.
  gives:
    answer: answer
takes:
  question: |
    What is Zinc?
gives:
  answer: answer

Zinc sends a request file path to the resolved program.

↯ Completion

Zinc does not use execution-state words in its API. advance returns a new assembly fragment when it moves. If it cannot move, it errors. zn run loops until the assembly fragment contains final result bytes.

Clone this wiki locally