DSL, backends and execution — package invariants
One entry per package, verbatim from the engine map this tree replaces. The generated map-packages.md lists every package with its purpose and interfaces; these leaves carry the invariants. iterion map find|impact|path answer the exact questions.
pkg/dsl/— DSL pipeline (parser → AST → IR) The compiledWorkflow— nodes, edges, schemas, prompts, vars, loops, budget — isir/ir.go.parser/— Lexer, parser, tokens, diagnostics for the .bot DSLast/— AST definitions andMarshalFile/UnmarshalFile(JSON encoder for AST)ir/— Intermediate Representation compilation and validationunparse/— IR back to .bot serializationtypes/— Shared enums (transports, field types, session/router/await/interaction modes)expr/— Expression evaluator forcomputenodes andwhenconditionsworkflowfile/— Workflow source-file loading + hash computation (used byiterion resumechange detection)spec/— The declarative property registry (a leaf): every kind's accepted properties with value shape and one-line doc. Held to the parser by a black-box conformance test in BOTH directions (a property added to one side without the other fails CI) and to the EBNF's*_propproductions. Feeds E012's remedy (closest name, the block a name belongs to, the kind's list —parser.unknownProperty, the one choke point), and rendersdocs/references/dsl-properties.md, the grammar's tables and the skills' property section (iterion dsl spec --write/task dsl:gen;task dsl:checkfails on a stale rendering). The parser'sisKeywordTokenis derived from the lexer's keyword table for the same reason: the hand-kept copy drifted twice
pkg/backend/— Execution stack (LLM + tools)model/— Executor registry (ClawExecutor), schema validation, event hooksdelegate/— Backend interface and CLI delegates (claude_code,codex,pi,kimi,grok,opencode);clawimplements the same interface in-process undermodel/tool/— Tool registry, policies, adaptersmcp/— MCP server lifecycle, configuration, health checksrecipe/— Recipe handling for tool adapters and execution policiescost/— Cost estimation and budgeting. Prices a call from three sources in order: claw's live registry, the spec aggregator's published pair (modelspecs, taken only when BOTH rates are positive — a half-published pair would price the other half at zero), then the committed static table. Zero is always unknown, never free:Annotateomits_cost_usdrather than emit a 0modelspecs/— The dynamic model-spec registry of ADR-042, extracted to a LEAF package (only iterion dep:pkg/store) socost/can read published pricing without inverting the import graph —cost/is a leaf precisely becausemodel/imports it (ADR-093). Serves a consensus-filteredSpec(context window, max output, prices, three flags) perprovider/modeland per baremodel; a field the publishers disagree on is zeroed, i.e. UNKNOWN, so the caller keeps its curated value. Supplies but does not decide — merging over the curated table stays inmodel/(mergeSpec).Default()is built lazily from the env (not at init, which would make a test'sITERION_MODEL_SPECS_CACHEtoo late);SetDefault/NewSeededare the cross-package test seam that keeps a price assertion off the host's~/.iterioncachellmtypes/— LLM SDK abstraction (LLMTool,FatalToolError,ModelCapabilities— carryingContextWindow/MaxOutputTokens/InputCostPerM/OutputCostPerM, every one zero-means-unknown)detect/— Backend credential auto-detection (OAuth, API keys, AWS/GCP) consumed bymodel/executor.go's resolver and the studio toolbar BackendStatusPilltooldisplay/— Human-readable rendering of tool calls for the run console / report
pkg/runtime/— Workflow execution engine (branch scheduling, events, budget, recovery dispatch)pkg/store/— Run persistence (JSON-based, versioned artifacts, events.jsonl)pkg/server/— HTTP server for studio backend (embedded static UI)pkg/runner/— Cloud runner pod logic: claim a queued run, execute, report status backpkg/runview/— Read-only run console API (REST + WS) consumed by the studio SPApkg/supervise/— LLM-driven supervisor agents (theCoordinator) that watch a running agent node from a separate goroutine/process and enqueue steering messages the run picks up at its next turn. Backs the in-.botsupervisorblock anditerion supervise(managed runs + rawclaudesessions). See docs/supervisors.mdpkg/forge/— Outbound forge-integration layer (github/gitlab/forgejo):Connection/RepoIntegration/OAuthAppstores (team-scoped), per-providerAdminclients (repos/hooks), GitHub App manifest flow + installation-token minting (least-priv,InstallationInfohealth probe), the optionalRepoCreatorcapability (create-only; GitHub Apps mint a per-calladministration:writetoken, an opt-in grant at App creation),Orchestrator(Provision/Deprovision: webhook + hook + managed secret + bot bindings + repo-bound schedules), and the token refresh worker. The studio's repo-first shell (RepoSwitcher, connect wizard/integrations/connect, launch "Target repository" attach-or-create from a bot's manifestrepo:block) sits on it — see docs/repo-scope.mdpkg/cli/— CLI command implementations (validate, import, run, inspect, runs, resume, fork, diagram, report, studio, server, dispatch, schedule, issue, bots, skill, marketplace, memory, models, openapi, bench, bundle, sandbox, migrate, secret, plugin, remote, supervise, version)pkg/benchmark/— Metrics collection and reportingpkg/botreplay/— Record/replay golden-test framework for bots: freezes one representative LLM node interaction (the input + output maps) as a committed fixture and re-validates it against the current schema + invariants with no API calls (task test:goldens). See docs/adr/008-bot-golden-replay-framework.mdpkg/log/— Leveled logger (error, warn, info, debug, trace) — public so e2e tests can construct itpkg/secure/httpdial/— Shared SSRF guard resolving operator-supplied hosts to safe public-unicast IPs with pinned DNS; backs webhooks, OIDC issuer fetch, and the preview proxypkg/internal/— Internal utilities (not importable outsidepkg/)appinfo/— Build-time version/commit injection (LDFLAGS targets)mongoutil/— MongoDB helpers used bypkg/cloud/for the cloud-mode Mongo storeproc/— Process/subprocess helpers (PID management, signal handling)
pkg/config/— Config-file loader (iterion dispatchYAML + cloud config)
