OpenProgram · Runtime design set

Self-Programming Agentic Workflow

A Workflow is a small ordinary Python project in its own Git repository. It uses the existing Agent method, calls other projects through normal imports, and combines goal(), agent() and llm() as the task requires. The detailed design is organized into three topic pages.

Sole decorator: Agent methodComposition: Python importVersioning: Git commitsFour management entry points separatedCategory migration and App acceptance in progress

1. Design questions and boundaries

The system manages multiple reusable Workflows. A Workflow can call another Workflow or directly call ordinary Functions, single model requests, Agent loops and Goal loops. Callers should not learn another API, and generated code should not pass string names to an additional dispatcher.

Public code has one meaning: import Python functions and call them. OpenProgram prepares importable code, establishes the Runtime context, records the DAG and isolates the execution environment.

Out of scope: Workflow DSLs, custom revision databases, remote Marketplaces, automatic push, background distributed scheduling and new model-tool protocols.

2. Current implementation and remaining differences

Current factsRemaining differencesTarget page
Agent method Python calls, tool registration, Runtime inheritance and the DAG are supported.An earlier design redundantly added @workflow and a call adaptation layer; these have been removed from the target design.Programming model
Discovery, creation, revision and user-triggered automatic execution are four registered functions; the former composite entry is no longer registered.workflow/ Category directories still need to be fully separated from Programs execution identity, followed by default-App acceptance.Discovery, creation and automatic execution
openprogram/programs/workflow/ is already the source of truth.Programs does not yet display Exports, Calls / Used by, Git or test status.DAG and Web UI
@workflow, call_workflow(), invoke_workflow(), Function sidecars and a public resolver/executor are outside the target architecture.

3. Documentation navigation

llm / agent / goalFormer #primitives
Workflow projectsFormer #project
Loading and executionFormer #runtime
Public acceptanceFormer #acceptance

4. References and decisions

ReferenceAdoptedNot adopted
Python import system / contextvarsStandard packages/imports and inheritance of the existing call context.Custom import hooks and string dispatchers.
Git commits / git worktreeProject history, commit snapshots and isolated changes.Revision directories and active pointers.
GitHub reusable workflowsIndependent reusable units, explicit inputs and composed calls.YAML Workflow DSL.
Existing OpenProgram Agent methodTool registration, DAG, Runtime, permissions, cancellation and provider/model inheritance.A parallel registration system.

5. Implementation status

CapabilityStatusDetails
Parameterized entry points, multi-file packages and independent Git repositoriesStages 1–3 completeNew projects use the same name as the project for method_options = dict(task).
Static cross-Workflow imports and reachable commit snapshotsStage 4 completeImplementation evidence exists for missing/cyclic dependency rejection, dependency snapshots and shared Runtime.
Legacy zero-argument single-file WorkflowResume compatibility onlyUsed only by historical runs explicitly resumed.
Single-Agent authoringDesign complete · not implementedRemove decision JSON and the separate author turn.
Executable test gate before publicationDesign complete · not implementedFailures, timeouts or cancellation must not produce a commit.
Programs → ApplicationsDesign complete · not implementedWorkflow is an Application source type; do not add a separate peer Workflows category.

Canonical design set entry. Implemented evidence through Phase 4 remains distinct from the three approved targets without implementation evidence.

Task scope in the installed knowledge research workflow

llm_knowledge_research makes one bounded planning call through the existing llm primitive before official arXiv retrieval. Its strict plan contains one to four ordered queries of at most 256 characters, with a supported theme, and respects the requested priorities and exclusions. The planner supplies retrieval intent only; it cannot supply evidence, dates, paths or paper results. Invalid plans fail before HTTP or output writes and do not trigger validation retries or a fixed-topic fallback. Retrieval retains at most four calls with 25 results each, the existing 2025/2026 publication filter, deduplication, provenance and five selected records per included theme. The report renders only planned themes and actual normalized abstracts; excluded-theme stock text is omitted. One Asia/Shanghai acquisition date is captured at invocation start and passed unchanged to the report. A standalone rendering call without acquisition metadata labels its current render date separately. No-result, planning, transport, cancellation and write failures retain the existing failure and output-preservation behavior. Public acceptance invokes the registered workflow with distinct broad and narrow requests, checks actual query receipts and persisted scope/date, and proves invalid plans perform no retrieval or write. Real model planning quality remains a separate acceptance check.

The plan explicitly permits the existing prompt fallback when a configured provider has no verified native or strict-tool structured-output contract. Schema validation and zero validation retries still apply; this does not introduce another model request, a repaired plan or a fixed query set. Acceptance reaches the production structured-output negotiation boundary for such a provider, then validates its single returned plan before any source request. A malformed response remains a typed failure with no retrieval or report write. Live provider and remote retrieval results are recorded separately from controlled acceptance.

Source result relevance

Search-engine matches are candidates, not confirmed members of the requested topic. After retrieval, one bounded selection call compares the original task and exclusions with the actual normalized titles and abstracts. It returns existing record identifiers only, with at most five per selected theme and no invented facts or rewritten metadata. Strict schema validation, explicit prompt fallback and zero validation retries apply. Unknown, duplicate or over-budget identifiers fail before writing; selection failure preserves the old report. Valid empty selection produces an honest report with no confirmed relevant records. Only selected source records enter the report, in returned relevance order, and the report labels them as selected candidates requiring PDF verification rather than claiming every paper contributes to a theme. The existing source-call budget, date, deduplication and provenance remain. Acceptance exercises the public entry with newer off-topic candidates and older relevant memory-security records, plus invalid selection and no relevant results. A real provider and source run checks the produced scope separately.

Task-specific source selection and the cancellation check before report writing are implemented and have passed independent specification and quality reviews. Public controlled checks preserve original metadata, selected order, caller cancellation and existing report bytes. A live configured-provider run performed query planning, official arXiv retrieval and record selection, producing directly relevant memory-security source candidates with matching acquisition metadata. Source checks, local package import and installed interface acceptance use separate receipts.