Typed Agent protocol: map/reduce/group/fold + SynixLLMAgent#128
Typed Agent protocol: map/reduce/group/fold + SynixLLMAgent#128
Conversation
Replace generic write(AgentRequest) gateway with typed operations matching pipeline transform shapes: - Agent Protocol: map(Artifact)→str, reduce(list[Artifact])→str, group(list[Artifact])→list[Group], fold(accumulated, Artifact, step, total)→str - agent_id (stable identity) separate from fingerprint_value() (config snapshot) - SynixLLMAgent: built-in implementation backed by PromptStore for versioned instructions, LLMClient for execution, system+user messages - Group dataclass: key + artifacts + content for group results - Workspace [agents.*] config parsing, load_agents() convenience - All 4 generic transforms updated for typed calls - 84 agent tests + 2214 total tests passing
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium-high risk: this PR changes a core public abstraction ( One-way doors
Findings
Missing
Verdict — Block: this PR introduces a user-visible API break and a deeper design regression by pushing transform semantics into agents without a compatibility plan or cache-safety proof. Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary This PR replaces the generic Alignment Strong fit. DESIGN.md specifies that provenance chains must be complete and cache keys must capture all inputs. Adding Observations
Verdict This is a well-executed interface upgrade that strengthens both the extension model and provenance tracking, with one real concern around the group-synthesis agent path bypassing caching semantics that should be addressed before merge. Review parameters
|
…, compat aliases - fingerprint_value() raises ValueError when prompt store not bound (was silently hashing empty string — cache safety issue) - load_agents() now passes api_key_env from config (was missing) - AgentRequest/AgentResult kept as deprecated aliases for backward compat
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary This PR replaces the generic Alignment Strong fit. DESIGN.md states agents don't own prompts, grouping, or fold semantics — transforms do. The old Observations
Verdict Good incremental step — the typed agent interface is a cleaner contract than the generic gateway, and Review parameters
|
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium-high risk: this PR changes a core extension point and cache semantics while introducing config-driven agents with weak compatibility and incomplete behavioral coverage. One-way doors
Findings
Missing
Verdict — Block: this PR breaks compatibility at a core extension boundary and quietly changes grouping ownership/semantics without docs, migration strategy, or sufficient tests. Review parameters
|
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium-high risk: this PR changes the agent abstraction in a way that leaks into cache semantics, artifact metadata, and pipeline behavior, with at least one direct violation of the project’s Python-first design. One-way doors
Findings
Missing
Verdict — Block: the abstraction shift is not just additive; it changes ownership of grouping/rendering, conflicts with the design doc, and introduces config/state behavior that is under-tested and hard to unwind. Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary Replaces the generic Alignment Strong fit with the vision. DESIGN.md says transforms own prompt rendering and semantics while agents are execution gateways. This PR pushes that further — agents now own rendering and execution for their shape, which is a cleaner boundary. The Observations
Verdict Good incremental step — the typed agent protocol is a meaningful improvement to the extension model, provenance gets richer with Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary This PR replaces the thin Alignment Strong fit. DESIGN.md says "architecture is a runtime concern" and "Python-first." This PR moves agent behavior closer to being a declarative, configurable runtime concern — agents defined in Observations
Verdict A well-motivated refactor that strengthens provenance and moves toward agents as first-class pipeline citizens; the group-path semantic divergence (observation 4) and protocol width (observation 2) deserve attention before this solidifies as the public extension API. Review parameters
|
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium-high risk: this PR changes the public agent API, shifts transform semantics, and introduces config/prompt-store coupling without enough migration, persistence, or failure-mode coverage. One-way doors
Findings
Missing
Verdict — Block: the group-agent semantic change is a design violation and the new agent/config API is being made public without migration, validation, or end-to-end compatibility proof. Review parameters
|
Transform renders its prompt (task structure) and passes it as
task_prompt to the agent. Agent uses task_prompt as user message,
its own instructions as system message. Both compose:
- Transform defines WHAT (e.g. "Summarize: {artifact}")
- Agent defines HOW (e.g. "You are a concise writer, 200 words")
Same agent works across different transforms. Same transform works
with different agents.
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium-high risk: this PR changes the public agent abstraction, mutates transform semantics, and introduces config/runtime coupling without proving cache, provenance, or compatibility are still correct. One-way doors
Findings
Missing
Verdict — Block: the agent API break is manageable, but the agent-driven grouping and PromptStore-dependent fingerprinting introduce architectural inconsistency and cache/provenance risk that is not justified or documented. Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary Replaces the generic Alignment Strong fit. DESIGN.md defines transforms as the core build rules and the agent as an "execution gateway." This PR keeps that separation — transforms still own prompt rendering ( Observations
Verdict This is a well-structured evolution of the agent interface that strengthens provenance tracking and correctly maintains cache semantics — a good incremental step, with the config-building duplication and missing TOML parsing tests as the main items to address before merge. Review parameters
|
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium-high risk: this PR changes a public extension point and partially redefines transform semantics, with at least one clear design contradiction and weak migration/docs coverage. One-way doors
Findings
Missing
Verdict — Block: the group-agent semantics are a real design break, and the public agent API change ships without migration or documentation. Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary Replaces the generic Alignment Strong fit. DESIGN.md §3.9 establishes audit determinism: every artifact must explain what produced it. Adding The typed methods ( Observations
Verdict This is a well-structured evolution of the agent interface that improves type safety, provenance tracking, and extensibility — but the Review parameters
|
Summary
Replaces the generic
write(AgentRequest) → AgentResultgateway (PR #126) with a typed Agent protocol matching pipeline transform shapes. Agents now own rendering + execution and have separate identity (agent_id) and config snapshot (fingerprint_value()).map(Artifact)→str,reduce(list[Artifact])→str,group(list[Artifact])→list[Group],fold(str, Artifact, int, int)→stragent_id(stable identity) separate fromfingerprint_value()(config snapshot for cache invalidation)SynixLLMAgent— built-in implementation backed by PromptStore for versioned instructions, LLMClient for execution, system+user messagesGroupdataclass —key,artifacts,contentfor group operation results (Agent-driven group routing: split artifacts into named groups for parallel downstream processing #127 tracks feed-forward variant)[agents.*]TOML parsing,load_agents()convenience for pipeline.pyagent=Nonepath unchangedKey design decisions
fingerprint_value()uses PromptStore content_hash (auto-invalidates cache on prompt edit)agent_id= stable name, doesn't change with config — separate lifecycle from fingerprintTest plan
uv run pytest tests/unit/test_agents.py -v— protocol + SynixLLMAgentuv run pytest tests/unit/test_agent_transforms.py -v— all 4 shapesuv run pytest tests/e2e/test_agent_pipeline.py -v— full pipelineuv run pytest tests/unit/test_ext_transforms.py -v— backward compatuv run release— full gate