Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
python-version:
- "3.12"
- "3.13"
- "3.14"
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:10:52Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# AGENTS

Expand Down
14 changes: 8 additions & 6 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-24T18:14:20Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Architecture

Expand Down Expand Up @@ -136,8 +136,8 @@ Use [filter_engine_events](src/graphon/engine/filter/chain.py) with
[ResponseStreamFilter](src/graphon/engine/filter/builtin/response_stream/filter.py)
and [EngineEventFilterContext.from_engine](src/graphon/engine/filter/protocol.py).
Keep frame events enabled so the filter receives its initial root baseline. The
filter consumes baselines and committed replacements internally. Its detached
view stays usable after the engine removes the frame.
filter consumes baselines and committed replacements without forwarding them.
Its detached view stays usable after the engine removes the frame.

Root templates come from the graph's response nodes. Child Answer and End
templates come from [retained graph definitions](src/graphon/engine/filter/builtin/response_stream/frame_graph.py)
Expand All @@ -148,9 +148,11 @@ only if its first consumed decision is a take. The engine may be ahead of the
consumer, so activation uses the events already consumed in that frame. See
[response gating regressions](docs/development.md#response-gating-regressions).

When a root reply repeats a streamed node output, the filter forwards each unread source chunk with its original final flag.
Once the final chunk has been read, remaining references in that reply emit the buffered text under the reply node's execution ID and text selector.
If the template ends with a repeated reference or a trailing literal, that segment closes the reply.
Root replies forward unread node-output chunks with the producer's execution ID,
selector, and `is_final` value. After the source closes and the filter reads its
chunks, a repeated reference emits the buffered text with the reply node's
execution ID and streaming text selector. When a repeated reference or literal
ends the template, its chunk has `is_final=True`.
See the [response filter tests](tests/engine/test_response_stream_filter.py).

[Template assembly](src/graphon/engine/filter/builtin/response_stream/template_stream.py)
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:10:52Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Contributing to Graphon

Expand Down Expand Up @@ -110,9 +110,10 @@ each with a new context-free subagent.
- Python compatible with [project metadata](pyproject.toml)
- [`uv`](https://docs.astral.sh/uv/)
- [`just`](https://just.systems/)
- [`fd`](https://github.com/sharkdp/fd)
- `git`

The optional `just clean` recipe also needs [`fd`](https://github.com/sharkdp/fd).

### Bootstrap

```bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:10:52Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Graphon

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:10:52Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Repository knowledge

Expand Down
22 changes: 13 additions & 9 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:18:53Z"
last_checked: "2026-11-26T01:14:08Z"
-->
# Development navigation

Expand Down Expand Up @@ -62,8 +62,13 @@ public surface.
[SlimLLM](../src/graphon/dsl/slim/llm.py) is the provided graph-facing adapter;
[code.py](../examples/slim_llm/code.py) shows direct wiring. Provider discovery
and capability wrappers have separate protocols; see the
[model runtime guide](../src/graphon/model_runtime/README.md) and
[dispatch tests](../tests/model_runtime/test_model_dispatch.py).
[model runtime guide](../src/graphon/model_runtime/README.md).
For polling, subclass [`graphon.protocols.LLMPollingCapableProtocol`](../src/graphon/nodes/llm/runtime_protocols.py).
A successful polling run emits the completed text in its final text chunk.
For complete results in `separated` mode, the node strips `<think>` blocks
from visible text and prefers nonempty `LLMResult.reasoning_content`, with
the extracted reasoning as a fallback.
See the [LLM node tests](../tests/nodes/llm/test_node.py).
- **Files and HTTP:** use the [file binding guidance](../ARCHITECTURE.md#state-and-execution-invariants)
when wiring engines, filters, or host rendering. Node-specific ports live in
[nodes/protocols.py](../src/graphon/nodes/protocols.py); generated LLM files use
Expand Down Expand Up @@ -102,12 +107,11 @@ and the [independent review sequence](../CONTRIBUTING.md#context-free-reviews).

- [Complexity tests](../tests/engine/test_response_stream_filter_complexity.py)
bound adjacency calls, retained state, and snapshot size on chains of diamonds.
Two graph passes per response use at most `2RV` adjacency calls for `R`
responses and `V` nodes. With `R <= V`, `V >= 2`, and `E >= V - 1` edges,
the budget is `2RV <= 4VE`. Nodes and edges both grow linearly with stages,
so doubling the stages approaches four times the budget. The tests require
observed call growth below that factor. Size checks cover one response
without source buffers and exclude borrowed graph and value-pool objects.
The `4VE` call budget allows two `V`-node traversals for each of up to `V`
responses on a connected graph with `E` edges. Doubling the stages approaches
four times that budget because nodes and edges both grow linearly with stages.
The size checks cover one response without buffered source text and exclude
borrowed graph and value-pool objects.
- [Differential tests](../tests/engine/test_response_stream_filter_differential.py)
compare response activation after each event against the previous path-based
behavior, including repeated and conflicting traversal observations.
Expand Down
2 changes: 1 addition & 1 deletion docs/maintenance.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:17:19Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Maintaining repository knowledge

Expand Down
24 changes: 6 additions & 18 deletions docs/technical-debt.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:18:53Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Technical debt

Expand Down Expand Up @@ -52,17 +52,8 @@ and [the extractor](../src/graphon/nodes/document_extractor/node.py) imports sev
eagerly. Minimal engine consumers inherit these dependencies. Measure installation
size and startup cost before claiming a benefit from optional dependencies.

Graphon's Python requirement and CI matrix include 3.14. A clean
`pip install .` on 3.14 currently fails because no `unstructured` release
on PyPI both meets Graphon's minimum version and accepts Python 3.14.
The lockfile selects `unstructured` 0.27.37, which declares
`Requires-Python: <3.14,>=3.11`. See [project metadata](../pyproject.toml),
the [lockfile](../uv.lock), and the
[distribution metadata](https://pypi.org/project/unstructured/0.27.37/#meta).

The CI test workflow resolves dependencies with `uv`, which ignores dependency
Python upper bounds. See the [CI matrix](../.github/workflows/test.yml) and
[uv resolution rules](https://docs.astral.sh/uv/concepts/resolution/#universal-resolution).
The required [unstructured dependency](https://pypi.org/project/unstructured/0.27.37/#meta)
limits Graphon's [Python support](../pyproject.toml) to versions below 3.14.

Consider one document-extraction extra within the existing distribution. Isolate
its imports, provide an actionable missing-extra error, retain a fully equipped
Expand Down Expand Up @@ -106,12 +97,9 @@ existing benchmarks, and

## TD-10 — Decision records

[Issue #199](https://github.com/langgenius/graphon/issues/199) and
[PR #200](https://github.com/langgenius/graphon/pull/200) cover decision records,
including HITL and model polling boundaries. Current behavior guides do not
substitute for accepted decisions.

Continue that work and reconcile it with [maintenance guidance](maintenance.md).
Continue the [decision-record proposal](https://github.com/langgenius/graphon/issues/199)
for design decisions such as HITL and model polling boundaries. Reconcile any
accepted convention with [maintenance guidance](maintenance.md).
Promote approved lasting rules to stable guides and executable checks.

**Completion:** accepted decisions have repository-local links and explicit
Expand Down
12 changes: 7 additions & 5 deletions examples/slim_llm/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:10:52Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Slim LLM Example

Expand All @@ -25,7 +25,10 @@ cd examples/slim_llm
cp credentials.example.json credentials.json
```

Fill in `credentials.json`. See the [Git ignore rule](../../.gitignore) and
Fill in the model credentials in `credentials.json`. For a remote daemon,
set `slim.mode` to `remote` and supply `slim.daemon_addr` and
`slim.daemon_key`. The example defaults to local mode. See the
[Git ignore rule](../../.gitignore) and
[PR file check](../../.github/workflows/pr.yml) for local-configuration exclusions.

Provide a Slim executable through `SLIM_BINARY_PATH`, place an executable named
Expand All @@ -46,6 +49,5 @@ uv run python code.py
uv run python code.py "Reply with only the word Graphon."
```

Running either workflow invokes a real model; `--help` only displays command
usage and needs no credentials or Slim executable. Use [settings.py](settings.py)
to choose local or remote daemon setup and resolve configuration errors.
Running either workflow invokes a real model. Use `--help` to check command
usage without credentials or a Slim executable.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = 'Apache-2.0'
license-files = ['LICENSE']
# Keep Python support aligned with `unstructured`, which currently declares
# `Requires-Python: <3.14,>=3.11`.
requires-python = '>=3.12,<3.15'
requires-python = '>=3.12,<3.14'
dependencies = [
'charset-normalizer>=2.1',
'defusedxml>=0.7',
Expand Down
7 changes: 5 additions & 2 deletions src/graphon/engine/command/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:10:52Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Commands

Expand All @@ -18,7 +18,10 @@ including writes completed before a later command update fails.
## Usage

Pass the channel to [Engine](../engine.py) through `command_channel`; each
channel belongs to one workflow execution.
channel belongs to one workflow execution. For Redis, use a unique `channel_key`
for each execution. Watch for
[`GraphRunPausedEvent` or `GraphRunAbortedEvent`](../../engine_events/graph.py)
to see when a queued pause or abort takes effect.

```python
from graphon.engine import Engine
Expand Down
2 changes: 1 addition & 1 deletion src/graphon/engine/layer/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-19T01:10:52Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Layers

Expand Down
6 changes: 1 addition & 5 deletions src/graphon/model_runtime/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- knowledge
last_checked: "2026-11-20T09:30:34Z"
last_checked: "2026-11-26T01:12:45Z"
-->
# Model Runtime

Expand Down Expand Up @@ -32,10 +32,6 @@ The adapter owns its meaning; `None` means no state, and any other value keeps
an assistant message nonempty. See the
[message tests](../../../tests/model_runtime/test_message_entities.py).

The LLM node uses a nonempty `LLMResult.reasoning_content` for complete results in `separated` mode, including completed polling requests.
When the field is `None` or `""`, it falls back to reasoning parsed from `<think>` tags; tagged reasoning is removed from the visible text in either case.
See the [LLM node tests](../../../tests/nodes/llm/test_node.py).

[LargeLanguageModel](model_providers/base/large_language_model.py) keeps the last
non-`None` assistant state per invocation for blocking results and `on_after_invoke`.
Emit complete snapshots: each replaces the previous state. Mixed text and content
Expand Down
Loading
Loading