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
18 changes: 8 additions & 10 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ require_file() {
semver_re='^[0-9]+\.[0-9]+\.[0-9]+$'

spec_ver() {
sed -n -E 's/^Version:\s*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' documentation/protocol/spec.md | head -n1
sed -n -E 's/^Version:[[:space:]]*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' documentation/protocol/spec.md | head -n1
}

py_ver() {
# Extract version under [project]
awk 'BEGIN{p=0} /^\[project\]/{p=1;next} /^\[/{p=0} p==1 && $1=="version"{gsub(/\"/ ,"",$3); print $3; exit}' pyproject.toml
awk 'BEGIN{p=0} /^\[project\]/{p=1;next} /^\[/{p=0} p==1 && $1=="version"{gsub(/"/,"",$3); print $3; exit}' pyproject.toml
}

js_ver() {
sed -n -E 's/\s*"version"\s*:\s*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/p' sdks/js_sdk/package.json | head -n1
sed -n -E 's/[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/p' sdks/js_sdk/package.json | head -n1
}

rs_ver() {
awk 'BEGIN{p=0} /^\[package\]/{p=1;next} /^\[/{p=0} p==1 && $1=="version"{gsub(/\"/ ,"",$3); print $3; exit}' sdks/rust_sdk/Cargo.toml
awk 'BEGIN{p=0} /^\[package\]/{p=1;next} /^\[/{p=0} p==1 && $1=="version"{gsub(/"/,"",$3); print $3; exit}' sdks/rust_sdk/Cargo.toml
}

require_file documentation/protocol/spec.md
Expand Down Expand Up @@ -52,10 +52,10 @@ fi
if git rev-parse --verify HEAD >/dev/null 2>&1; then
CHANGED=$(git diff --cached --name-only)
base_ver() { git show HEAD:$1 2>/dev/null | sed -n -E "$2" | head -n1; }
BASE_SPEC=$(base_ver documentation/protocol/spec.md 's/^Version:\s*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')
BASE_PY=$(base_ver pyproject.toml '/^\[project\]/,/^\[/{s/^version\s*=\s*"([^"]+)"/\1/p}')
BASE_JS=$(base_ver sdks/js_sdk/package.json 's/\s*"version"\s*:\s*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/p')
BASE_RS=$(base_ver sdks/rust_sdk/Cargo.toml '/^\[package\]/{p=1;next} /^\[/{p=0} p==1 && $1=="version"{gsub(/\"/ ,"",$3); print $3; exit}')
BASE_SPEC=$(base_ver documentation/protocol/spec.md 's/^Version:[[:space:]]*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')
BASE_PY=$(base_ver pyproject.toml '/^\[project\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p}')
BASE_JS=$(base_ver sdks/js_sdk/package.json 's/[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/p')
BASE_RS=$(git show HEAD:sdks/rust_sdk/Cargo.toml 2>/dev/null | awk 'BEGIN{p=0} /^\[package\]/{p=1;next} /^\[/{p=0} p==1 && $1=="version"{gsub(/"/,"",$3); print $3; exit}')

greater() { python - "$1" "$2" <<'PY'
import sys
Expand Down Expand Up @@ -132,5 +132,3 @@ if echo "$CHANGED" | grep -E '^sdks/rust_sdk/.*\.rs$' >/dev/null 2>&1; then
fi
popd >/dev/null 2>&1
fi


9 changes: 6 additions & 3 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ jobs:

- name: Install dev dependencies
run: |
python -m pip install -e ".[dev]"
python -m pip install -e ".[dev,test]"

- name: Install SBCL runtime
run: |
sudo apt-get update
sudo apt-get install -y sbcl

- name: Run smoke test (protos + imports)
run: |
python scripts/smoke_protos.py

- name: Run Python unit tests
run: |
python -m pip install pytest
pytest -q sdks/py_sdk/tests

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ PROMPT.md
RALPH_PROMPT.md
ralph.yml

# Internal implementation status/readme artifacts
sdks/SDK_IMPLEMENTATION_PROGRESS.md
sdks/py_sdk/sw4rm/CROSS_CUTTING_README.md
sdks/py_sdk/sw4rm/METRICS_README.md

# Generated protobuf stubs
sdks/py_sdk/sw4rm/protos/*.py
sdks/py_sdk/sw4rm/protos/*.pyi
Expand Down
2 changes: 1 addition & 1 deletion docs/CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This file captures the current state, decisions, and next steps for the SW4RM Ag
- Advanced features: streaming support, comprehensive observability, retry logic
- Type safety with compile-time guarantees
- Performance optimizations and enterprise-grade error handling
- Comprehensive documentation and examples (`sdks/SDK_IMPLEMENTATION_PROGRESS.md`)
- Comprehensive documentation and examples (protocol extensions + operational docs)

### Documentation Content & Structure
- Implemented hierarchical numbering system across all documentation:
Expand Down
4 changes: 2 additions & 2 deletions documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ The built site will be in the `site/` directory.

Cross-SDK implementation status for the inter-swarm extensions is tracked in:

- `sdks/SDK_IMPLEMENTATION_PROGRESS.md` (capability matrix by SDK)
- `documentation/protocol/extensions/index.md` (extension-level status summary)
- `artifacts/verification/` (evidence snapshots for verification claims)

When updating SW4-004 or SW4-005 docs/claims, update both files together so conformance wording and SDK parity reporting stay consistent.
When updating SW4-004 or SW4-005 docs/claims, update the extension status page and evidence snapshots together so conformance wording and parity reporting stay consistent.

## Phase Status (2026-02-15)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# How SW4RM Coordinates Code-Writing Agents

**Issue:** I141

## Why Coordination Is Hard

Multi-agent coding teams rarely fail because no one is smart enough to write code.
They fail when communication, ownership, and task boundaries are unclear.

In SW4RM, we use explicit protocol-level coordination so agents stay autonomous without
becoming chaotic:

- each agent publishes/consumes standard envelopes,
- task ownership is explicit,
- state transitions are observable,
- and completion criteria are machine-checkable.

## How SW4RM Helps

SW4RM’s protocol design gives code-writing teams:

- a shared contract for routing and negotiation,
- deterministic handoff paths between agents,
- explicit heartbeat and recovery semantics,
- and extension points for tracing and observability.

That means a code-writing agent can hand a partial implementation to a reviewer,
where the reviewer can request targeted revision loops instead of re-deriving context.

## The “LLM Integration” Pattern

Across all SDKs, the LLM integration extension follows the same pattern:

1. Keep provider specifics behind a narrow adapter interface.
2. Route all orchestration requests through protocol messages, not out-of-band side channels.
3. Record agent decisions in extension state so future turns can continue from concrete artifacts.
4. Use metrics and trace signals to catch quality regressions early (retry spikes, queue delays, nacks).

For SW4RM today, this keeps “agent writes code” and “agent critiques code” in the same
coordinated loop with auditable inputs and repeatable exits.

## What We Changed in This Cycle

- Added production-capable metrics backend plumbing for Python SDK emitters (StatsD/Datadog path).
- Updated cross-SDK extension docs so the LLM Integration extension is tracked across all five SDKs.
- Continued hardening the production tranche queue so observability and operational readiness stay aligned.

## Why This Matters

When each SDK and agent follows the same coordination contract, we can scale code-writing effort safely.
The team gains:

- faster iteration with fewer blind spots,
- clearer recovery when one agent diverges,
- stronger governance through logged handoffs and metrics,
- and a reusable operating model for future autonomous coding tranches.

---

This post is the checkpoint write-up for I141 in the SW4RM execution stream.
2 changes: 1 addition & 1 deletion documentation/protocol/extensions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Implementations may claim conformance to specific extensions:
- Rust: SW4-004/SW4-005 wire fields, caller redirect helper, gateway redirect-emitter helper, cancellation helper behavior, full SW4-004/SW4-005 conformance coverage, and shared vector adapters.
- Common Lisp: SW4-004/SW4-005 wire fields, caller redirect helper, gateway redirect-emitter helper, cancellation helper behavior, full SW4-004/SW4-005 conformance coverage, and shared vector adapters.

See `sdks/SDK_IMPLEMENTATION_PROGRESS.md` for the authoritative cross-SDK capability matrix.
This table is the canonical public cross-SDK implementation status; supporting evidence is maintained in `artifacts/verification/`.

## Extension Lifecycle

Expand Down
4 changes: 2 additions & 2 deletions documentation/protocol/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

([Link to full RFC](https://github.com/rahulrajaram/sw4rm/blob/master/documentation/protocol/spec.md))

**SW4RM Protocol v0.6.0** | **Status: Production Ready** | **Last Updated: 2026-02-15**
**SW4RM Protocol v0.6.0** | **Status: Production Ready** | **Last Updated: 2026-03-06**

Related documents:

Expand All @@ -13,7 +13,7 @@ Related documents:

??? note "Changelog"

**0.6.0 (2026-02-15)**
**0.6.0 (2026-03-06)**

- Versioned extension structure: normative protocol evolution is now tracked
in versioned extension release files (`extensions/v0.N.0.md`). The core
Expand Down
6 changes: 3 additions & 3 deletions documentation/protocol/sdk_extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ Agent thread spawning infrastructure (`colony/` module). Provides `Spawner`
base class and thread-based agent lifecycle management. This is an
application-level concern not specified in the protocol.

## 10. LLM Integration (Python only)
## 10. LLM Integration (All SDKs)

**SDK**: Python
**SDKs**: Python, JavaScript/TypeScript, Rust, Elixir, Common Lisp

Claude SDK adapter (`llm/` module) for integrating language model inference
Provider-agnostic LLM adapters and factories for integrating language model inference
into agent decision-making. Protocol-agnostic; the spec does not prescribe
inference engine integration.

Expand Down
4 changes: 2 additions & 2 deletions documentation/protocol/spec.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RFC: SW4RM - Interruptible, Message-Driven Agent Coordination Protocol

Version: 0.6.0 (2026-02-15)
Version: 0.6.0 (2026-03-06)

## Versioning and Changelog

Expand All @@ -10,7 +10,7 @@ The versioning scope encompasses this document and the canonical protocol buffer

**Changelog:**

- **0.6.0 (2026-02-15)**: Versioned extension structure. Normative protocol
- **0.6.0 (2026-03-06)**: Versioned extension structure. Normative protocol
evolution is now tracked in versioned extension release files
(`extensions/v0.N.0.md`). This document (`spec.md`) is frozen as a static
core specification where only the version number changes. See
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ nav:
- examples/index.md
- Use Cases: examples/use-cases.md
- Deployment Patterns: examples/deployment.md
- Blog:
- "I141: How SW4RM Coordinates Code-Writing Agents": blog/i141-how-sw4rm-coordinates-code-writing-agents.md
- Architecture:
- architecture/index.md
- State Machines: architecture/state-machines.md
Expand Down
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sw4rm-sdk"
version = "0.5.0"
version = "0.6.0"
description = "SW4RM Agentic Protocol — Reference Python SDK (experimental)"
readme = "README.md"
requires-python = ">=3.9"
Expand All @@ -23,6 +23,12 @@ dev = [
"twine>=5,<6",
"pkginfo>=1.10,<2",
]
test = [
"pytest>=7.0,<9",
"pytest-asyncio",
"groq>=0.4",
"anthropic>=0.18",
]
docs = [
"mkdocs>=1.5.0",
"mkdocs-material>=9.4.0",
Expand Down
23 changes: 0 additions & 23 deletions scripts/git-hooks/pre-commit

This file was deleted.

Loading