跳转到主要内容
Chinese, Simplified

category

正文

Putting an agent loop inside Fortran 2008 is an engineering choice, not a performance stunt.

The runtime is already used in research, simulation, HPC, energy, and aerospace. Porting the model to Python is not a refactor. It is a revalidation program: numerical kernels, libraries, performance profiles, and validation history all move.

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

options%provider => provider
options%tools => tools
options%events => sink
call run_agent(options, state, 'hello', run_id, result, error)
if (error%failed()) print *, error%code

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_types, praxo_interfaces messages, sessions, tools, policy, event sinks
praxo_agent, praxo_context bounded loop, context budget, compaction
praxo_json, praxo_schema bounded JSON and declared schema subset
praxo_toolcall JSON, XML-style, dotted-tag, and plain tool calls
praxo_policy, praxo_plugin lexical paths and manifest validation
praxo_middleware, praxo_stream limits, fallback, redaction, stream kinds
praxo_checkpoint, praxo_runtime checkpoint envelopes and event sinks

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

GNU Fortran at runtime; Python 3.10+ only for fixture translation and 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

  • The bounded JSON Schema subset remains partial.
  • Some P2 stream options remain partial; the stream part itself is parity.
  • No asynchronous runtime.

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: 262,144 bytes, 4096 nodes, 64 nesting levels.
  • Bounded JSON Schema subset; stream part is parity, some stream options partial.
  • PII redaction is pattern-based.
  • No MPI, OpenMP, GPU, netCDF, or HDF5 integration claim.

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 MPI/OpenMP/GPU integration.
  • You need full JSON Schema coverage.
  • You cannot accept caller-supplied transports and explicit numerical boundaries.

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 Fortran 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/fortran/
Matrix: https://github.com/axisvela/praxo-core/blob/main/spec/languages.md
Canonical: https://architect.pub/fortran-model-agent-deep-dive

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