跳转到主要内容
Chinese, Simplified

category

正文

Putting an agent loop inside GnuCOBOL 2.0+ is an engineering choice, not a performance stunt.

The runtime is already used in banking, insurance, government, and airlines. A load-bearing batch program is not just code. It holds transactions, reconciliation, audit trails, and change-control knowledge that have survived for decades because they work.

PRAXO-CORE keeps the runtime and embeds a governed loop. This article covers the entry point, the modules, the tool boundary, the partial surfaces, and when not to use it.

Entry point

call "praxo-run" using px-options px-session px-prompt
    px-result px-user-data

The entry point carries options, a session, a prompt, and caller-owned state. The application supplies model callbacks, tool dispatch, policy, and events. The loop owns ordering and contract checks; it does not own the business policy content.

Modules and packages

Surface Purpose
praxo-run agent loop, options, session, policy, tools, events
praxo-json-*, praxo-utf8 bounded JSON and UTF-8
praxo-jsonschema declared object/array schema subset
praxo-toolcall JSON, XML-style, dotted-tag, and plain tool calls
praxo-middleware step limits, tool selection, fallback, structured output, email redaction
praxo-memory in-memory session records and search
praxo-checkpoint, praxo-context checkpoint envelopes and context budget
praxo-policy, praxo-path-normalize lexical path grants and normalization
praxo-plugin, praxo-stream manifest validation and stream-kind constants

The design follows the language rather than importing a foreign object model. The goal is a small, auditable surface that fits the runtime’s existing idioms.

Tools and callbacks

A tool registration is not just a function pointer. The boundary has to define how arguments are parsed, how the policy sees final arguments, how results and failures propagate, and how events and checkpoints record what happened.

The implementation supports the tool-call formats recorded by the language README. Different models and provider prompts produce different shapes; the runtime should not assume one.

Dependencies

GnuCOBOL 2.0+ at runtime; Python 3.10+ only for the test driver. A compiled consumer does not need Python.

This is not “zero dependencies in the abstract.” It is a deliberately small dependency surface that an operator can audit.

Partial surfaces

  • tool.Registry and several P1 parity rows remain partial.
  • Stream parts and event session/run IDs remain partial.
  • Process plugin host integration is partial through the C ABI.

Publishing partials is part of the contract. A framework that hides them makes the integration boundary look simpler than it is.

Cost and scope

  • JSON input: 32,768 bytes, 512 nodes, 64 nesting levels; generated JSON: 16,384 bytes.
  • Bounded ASCII schema patterns; unsupported patterns fail explicitly.
  • Path policy is lexical, not OS confinement.
  • Email redaction only; not general PII.
  • Synchronous events and streams; not an async runtime.

The current scope also does not claim full Go parity. Check the parity inventory before depending on an optional surface.

When not to use

  • You need IBM z/OS support.
  • Your payload regularly exceeds 32 KB and cannot be split.
  • You need an async high-throughput runtime.
  • You cannot accept integration work around options, callbacks, policy, and build/link.

If one of these applies, a bridge, sidecar, migration, or a different runtime may be the better answer. That is a boundary mismatch, not a failure.

Conclusion

The value of a native COBOL loop is not that it makes the language fashionable. It is that the governance boundary can stay close to the work, with an explicit scope and explicit failure modes.

Repo: https://github.com/axisvela/praxo-core
Language source: https://axisvela.github.io/praxo-core/languages/cobol/
Matrix: https://github.com/axisvela/praxo-core/blob/main/spec/languages.md
Canonical: https://architect.pub/cobol-batch-agent-deep-dive

本文地址
最后修改
星期六, 十一月 21, 2026 - 18:16
Article
↑