Repository navigation
feat: multi-agent grouping (0.9.0) - #96
Conversation
….7.0 Fold Unreleased fixes into the 0.7.0 changelog entry
Release 0.8.0
|
Generated by Claude Code |
…ules Extracts the design from CLAUDE.md into the repo's spec/plan convention: the invariants C1-C7, the acknowledgement contract, the selection and fan-out rules of sec. 7.7, and acceptance criteria for both. Adds the multi-replica warning to the deployment guide, and the rule that this feature is worked one reviewable change at a time. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ca (#81) Nothing here is about grouping yet -- these are the defects that block running a second replica of anything. P0: subscribe() takes the whole topic map and is managed by the framework, with background retry, re-subscription after reconnect and subscriptions_ready gating readiness; in-flight handlers drain before the connection closes; an undecodable payload is distinguished from a failed dispatch. P1: Core NATS subscriptions join a queue group derived from the agent, so a second replica stops processing every message a second time. P2: a normal return acks and a raised exception naks or terms per the spec table, on both transports; NO_HANDLER_FOUND acks instead of looping to max_deliver; unmatched events are counted, not flagged. P3: ack_wait, max_ack_pending and max_deliver are configurable on a ConsumerConfig the client owns; the durable carries a deliver group so JetStream shares load; what the framework gives up on is republished to <queue group>.dead-letter. Dapr: the subscription document is served, so declared topics actually subscribe and GET /dapr/subscribe stops answering 422. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The handler chain skips an event whose id and source it has already dispatched, keyed in the cache under a required TTL. Off unless idempotency_enabled is set, and a failed dispatch releases its claim so the nak's redelivery still runs. Duplicates are counted apart from unmatched events, so a redelivery storm does not read as a namespace subscribed too broadly. The scaffold, the generated settings and asbs validate all make the author decide. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…e ticks once (#43, #73) scheduler_mode is required and has no default. "event" starts no in-process timer -- the tick arrives as an ordinary event on the scheduler's own topic, so the queue group picks one replica and nothing is elected. "in_process" keeps the timer and claims each tick in the shared cache, so one replica runs it; not a lease, so there is no renewal task and no takeover bound. Fixes both causes of #43: a second build() pass no longer starts a second timer, and SchedulerBase sitting in the REST-API lifespan loop as well as the scheduler loop no longer starts two AsyncIOScheduler instances per scheduler. Adds CacheService.claim -- set-if-absent, atomic on both backends. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Clients take a namespace, register under a namespace-qualified name so two can coexist in one registry, and derive queue group and durable from the namespace alone -- without which two co-hosted agents on one topic would share a queue group and each see half their events. Connections are named <namespace>.<group>.<pod>, so a pod's contents are legible in /connz while nothing broker-side derives from the pod (C1). One definition of the root namespace, and one alphabet validated wherever a namespace enters the framework. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Config masking matched whole keys only, so anything with a prefix or suffix around the secret word came back in clear. Present on develop since 4e6421b and unrelated to this feature; found and fixed here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Phase 0-1. One Config loads the tree; for_namespace hands out a view that reads <scope>.<key> and falls back to the root. The application owns logging rather than the library, app_port stays a process-level key, the config loader is unreachable from agent code, and a project chooses its own environment-variable prefix. run_app lets a project serve itself from its own settings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Phases 2-4. The namespace is ambient -- captured from the scope at the call site, never named by developer code and never forwarded to a constructor -- so one declaration can be applied alone or once per namespace. The registry resolves per namespace with the root as fallback, each namespace gets its own thread pool, and a cache gains a name with its own store and its own partition per agent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Phases 5-7. Dispatch is indexed on declared event types, wildcard by default, and each event goes to one agent's handlers; subscriptions are per agent, so two agents may want the same topic; one transport client is wired per agent and none for an agent that needs none; each agent's routes mount under its own prefix; every named cache is managed and probed, not only the default. On Dapr the one endpoint routes and fans out in the process. A handler may say which agent runtime should serve an event. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Phase 8. The name given in code is the agent's identity and app_name is only the fallback; any name that cannot identify one agent fails at startup. GroupConfig resolves which agents a process hosts from a file and the environment, AppBuilder applies the resolved group one namespace per agent, and python -m blueprint.agents.entrypoint is the container's command: it resolves, builds and serves. pyyaml is now declared rather than reached through a transitive dependency. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Phase 8b. Every with_* call is recorded and built in build(), AgentBuilder records and builds against the agent's own configuration view, and AgentGroup collects named declarations into one process. The three duplicate declaration surfaces are deleted (AgentRegistration, RegisteredComponent, NamespaceBuilder, with_namespace/with_registration). A cache is private to the agent that declared it, keyed on (namespace, name) with its own directory and Redis prefix; every health check is attributed to its agent; an agent's own settings file merges under its scope. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ocuments AGENTS.md is the file CLAUDE.md has been citing for months and did not exist. Its design rules now have test guards, which found and fixed real violations. Four overlapping cache documents became one, rewritten against the code -- which turned up a 500 in GET /cache/stats, fixed in the same change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Phase 9. Spans from namespace invoice carry service.name = "invoice" (C2); a degraded namespace reports liveness UP, readiness per policy and blueprint_namespace_up = 0 with its consumers stopped (C3, C4); every path that stops a namespace serving emits an ERROR carrying that namespace's identity (C7). Adds blueprint.scheduler.tick_age_seconds and blueprint.events.dead_lettered. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ate it Phase 10 step 1-2. asbs setup writes a declaration rather than an application: src/main.py assigns an unbuilt AppBuilder, agents.toml names the agent and its module, and the Dockerfile's command is the entry point. The same project runs standalone and hosted. asbs validate reports what a project has not said about grouping. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…at matches Phase 10 step 3-4. The setup guide covers both paths -- a new project and migrating an existing single-agent one -- the identity decision to get right first, what changes and what does not, and the cold cache after the move. Writing them found defects, fixed in the same changes. The deployment guide is rewritten against what the feature actually ships. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…omewhere to go (#80) tests/integration/ was not run by CI and sat at 28 failures asserting on examples that had been removed, so nothing added there would have meant anything. The split is now enforced by location, and the example assertions that still mean something moved to tests/unit/examples/. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ect start An agent can no longer read a neighbour's data by any route the framework offers, and asbs setup produces a project that starts, tests and validates. Isolation 1: the registry's bare-name fallback checks ownership, so it reaches the root and the asking agent and never a neighbour's key. Isolation 2: _effective_namespace and _cache_owner refuse a view that names another agent. Isolation 3: AgentGroup refuses a declaration shared by several agents that carries mutable state; a zero-argument factory is the way out. Isolation 4: a scoped get() resolves a dotted key only under the framework's own prefixes, an allowlist that fails closed. AgentRuntime is constructed with its name and registered under the qualified key like every other component, so two agents may share a runtime name. nats_publish_mode splits publishing from durable consumption, publishable subjects are declared, and a wildcard publish subject is refused at startup. env_status on a scoped actuator reports its own scope, not the tree. token_metrics_enabled reaches ObservabilityConfig; it was read by nothing. Generator: the scaffolded settings file writes the flat keys the framework reads, .secrets.toml is the name DEFAULT_SETTINGS_FILES loads, a pyproject.toml and two tests are generated so setup -> pytest -> validate closes, use_utf8 at the CLI entry point, and asbs create writes relative imports. Five example app_name values the broker refuses are renamed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`DEFAULT_SETTINGS_FILES` is `["settings.toml", ".secrets.toml"]` and `asbs setup` now scaffolds that name, but this repository only ignored the undotted `secrets.toml` -- so a `.secrets.toml` created here was stageable. Both names are ignored now, each spelled out rather than `.secrets.*`, which would also hide the committed `.secrets.toml.example`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The README never mentioned grouping, and its `AppBuilder` example taught three things the scaffolder no longer writes: `build()` inside `main.py`, a component instance on the `with_*` line, and the undotted `secrets.toml`. Standalone is unchanged and says so -- a built module-level `app`, a factory, or `agent.build(config)`, all still at the root namespace with the same registry names, routes, queue group, durable and `service.name`. Added beside it: what `agents.toml` declares, that `BLUEPRINT_AGENTS` decides which agents a process runs, what each hosted agent owns and what stays shared, that agents in one process are isolated, and that the name in `agents.toml` is the agent's identity everywhere else and renaming it later is a consumer migration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Section 12 had 3 of 27 boxes ticked while most of the work behind them had landed, so the normative document read as though nothing was done. Each criterion is now verified against the suite and sorted: 18 met, each naming the test that holds it; 3 built and unit-tested but written to ask for something only a real broker shows, pointing at tests/integration/; 5 genuinely not done, each saying why (no CI gate, no CronJob renderer, no fan-out gauge, no exhaustive detached-task test, no RSS benchmark); and 1 superseded, because per-namespace filter_subjects became unnecessary when each agent got its own durable. All 27 are still present. Nothing was ticked that a test does not hold. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CHANGELOG.md carried one entry for #76 and nothing about grouping, which is the document a consuming service opens to answer "what breaks". The 0.7.0 entry now states it: what was added, eleven breaking changes in the order a consumer is likely to hit them, what was fixed with the issue it closes, and what is knowingly still open. Assessed against the open issues rather than the commit log. Closed here: #91 (/status/env in clear), #81 (Dapr declared topics never subscribed), #28 (resilient broker startup and subscription readiness -- P0 meets its acceptance criteria, including event_client_max_retries and event_client_retry_delay), #73 (duplicate cron ticks under replicas), #43 (schedulers starting twice, both causes), #4 (AgentBuilder building a model during __init__), #80 (the test split), and #76 ships with it. Listed as still open rather than claimed: #89 -- Config passes current_env= to Dynaconf where the selector is env=, so the resolved environment is never loaded. The configuration layer was reworked substantially here and that defect survived it, which is worth saying out loud next to a release that rewrites config. #75 is materially answered by the spec but its ADR is outstanding, and #32/#35/#36 are enabled but unmeasured. One claim was checked and dropped before it shipped: an earlier draft said a group of two or more consuming agents on Dapr fails at build(). It did in phase 6, and phase 7 replaced it with in-process fan-out (test_dapr_fanout.py). The real caveat is what the entry says instead -- one acknowledgement is shared, so a retry asked for by one agent redelivers to all. Version bumped to 0.7.0. The publish workflow overwrites this from the tag, so it is the tree being honest rather than the source of truth. The version this commit sets is 0.7.0, and that is wrong: 0.7.0 and 0.8.0 were already published to PyPI from develop on 2026-09-04 and 2026-09-07. The number was chosen against a stale `origin/main` and a tag list that had not been fetched. The merge with develop that follows corrects it to 0.9.0 and restores the two released entries this changelog was missing. The subject no longer carries a version so that the log does not advertise a number that was never this branch's to claim. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CI failed on `test_every_directory_is_a_project_or_is_listed` and `test_no_listed_directory_has_quietly_become_a_project[customer_support_qa]`: `NOT_PROJECTS` listed `customer_support_qa`, and on a clean checkout there is no such directory. `examples/customer_support_qa` was deleted in `ef6cd03`, long before this branch. Git removes tracked files and nothing else, so its `__pycache__` directories stayed in the working copy -- nine `.pyc` files and not one tracked file -- and because `.pyc` is gitignored, `git status` stayed clean and the husk looked like a real example. The entry's description was written off that husk, which is why it reads "src/api, src/handlers, src/models and src/services but no main.py": those are the directories `__pycache__` leaves behind, and `main.py` was gone because only `main.cpython-314.pyc` remained. The guard was right and the entry was fiction, so the entry is removed. `example_directories()` now also requires a directory to hold a file that is not a `.pyc`. Without that, this test answers one way on a working copy carrying a husk and another on CI, which is how a green local run shipped a red remote one. The helper's docstring records the incident and the hash. Verified against CI's condition rather than assumed: the tree was exported with `git archive HEAD`, confirmed to contain no `customer_support_qa`, and the tests run there -- 28 passed. Full unit suite green, ruff and black both clean on the file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch forked before 0.7.0 and 0.8.0 were cut, so it carried neither. It also claimed 0.7.0 for itself, chosen against refs that had never been fetched. Version is 0.9.0. CHANGELOG.md is composed by ownership rather than by picking a side: develop owns the head, [Unreleased] and the released 0.7.0/0.8.0 entries; this branch owns [0.9.0] and everything from 0.6.4 down, which carries its fix to the broken link in the 0.3.4 entry that taking develop's file wholesale had reverted -- the reference guard caught that. The #76 bullet is dropped from [0.9.0]: it shipped in the real 0.7.0. Two conflicts needed judgement rather than a side. In api_client.py both imports are required. In test_app_builder.py both sides added a test class at the same offset and git interleaved their method signatures; develop's change is a pure 66-line insertion (TestBuildDocsUrls), re-applied onto this branch's file so all three classes survive. One conflict git resolved textually and wrongly: develop's new docs_url, redoc_url and openapi_url kwargs read self._config, which this branch made Config | None. They now read resolved_config, the settled process-level configuration its three neighbouring kwargs already use and the one develop's own comment asks for. mypy caught it; without the fix build() raises for every project that passes configuration to build() rather than to the constructor, which is every grouped agent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
solicho
left a comment
There was a problem hiding this comment.
This PR's base is main, but its head branch is feature/multi-agent-namespaces, not develop.
In this repo, main only ever advances by merging develop into it — every recently-merged feature/fix PR here (e.g. #92, #88, #78) targeted develop; main picks those up via a separate develop→main merge. A feature branch merging straight into main bypasses that path.
Could you retarget this PR to develop (gh pr edit 96 --base develop)? If the intent was actually to cut a release/sync main with develop, the right shape for that is a develop→main PR, not a feature branch standing in for one.
Not a comment on the change itself — I haven't reviewed the diff content, just the base branch.
d9f3bc1 to
87c4d37
Compare
…iew fixes A read-only audit compared every user doc, the claude_docs skills, README, AGENTS, CONTRIBUTE and the grouping spec with the code after steps 1-21; each stale statement was corrected (shared volume, non-deterministic order, debug mode, disk-cache atomicity, declaration order, the standalone shape, the agent map). The spec records D23: deterministic NATS faults fail early in every agent; a missing binding-mode stream or consumer is deferred and listed under Known issues in the CHANGELOG. The CHANGELOG also describes the validator's new reading of settings. AGENTS.md cites the concept docs by their full path again. Plan: docs/plans/2026-10-16-pr96-review-fixes.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Findings M1-M12, S1-S27, N1-N20 with their verification, the steps and what each one did, and the decisions D1-D23. Open: step 22 (D23, N12, N15, N16, N19), N18 (the generated handler's event type) and D22 (disk-cache claim across processes). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Findings M1-M12, S1-S27, N1-N20 with their verification, the steps and what each one did, and the decisions D1-D23. Open: step 22 (D23, N12, N15, N16, N19), N18 (the generated handler's event type) and D22 (disk-cache claim across processes). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@SawwR re the version check ("Version not bumped"): thanks -- the version is deliberately not bumped by hand. So this PR now leaves Done in 2b01afa. Answered with Claude Code; owner decisions by Jan. |
…y; telemetry and validator parity
Step 22 of the review-fix plan (D23, D21/N12, D17, N15, N16, N19).
22a (D23): a durable that filters another subject, a stream the server refuses, a grant the
account lacks, and on a named connection a refused login or deliver subject are
DeterministicTransportErrors: never retried, logged CRITICAL with what to change, and fatal in
every agent -- at startup the start fails whatever critical_agents says, after it /health/live
answers 503 naming the agent (spec C3 amended). A JetStream grant refused before startup used to
leave the agent paused for good with nothing logged. A stream another agent of the process created
meanwhile (10058) is a race, not a refusal. Named connections read "failed".
22b (N12, D21): a resume that keeps failing or a connection loop that gave up takes liveness DOWN
until the agent consumes again; an agent latched down gates readiness under every policy.
22c (D17, N16): a service.name only in OTEL_RESOURCE_ATTRIBUTES fails a group's start; an
agent's own otel_service_name reaches its resource. 22d (N15): app_environment reads the
environment that was loaded, with a WARNING when the settings say otherwise. 22e (N19): seven
startup rules are public runtime functions the validator calls; the validator's heartbeat warning
(N17) and the runtime's Dapr shared-topic warning ("false" read as on) had drifted.
Live in WSL against the code before this step: durable clash 8 attempts in 4 s and liveness 200
before, one refusal, CRITICAL and liveness 503 now; a refused grant paused the agent silently
before, fails the start now. Integration 70 of 71 (the pre-existing redelivery-count failure).
New: tests/integration/test_final_faults.py; tenancy faults in test_named_connections.py, whose
D5 tests now use an unreachable broker; a conftest guard fails a test whose app sends SIGTERM.
Plan: docs/plans/2026-10-16-pr96-review-fixes.md.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A colleague ran all 19 agents of the first consumer on 0.9.0a16 against a local backend. B1 (owner decision): the NATS publish route, which has no authentication, refuses a subject one of the agent's tenants owns -- claimed by the connection source, or filtered or delivered to by a tenant binding -- with 403: an anonymous POST put an event into a tenant's stream, to run under the tenant's identity. operator_routes_enabled = false (process scope) leaves the publish and the cache routes out; Dapr's delivery route stays. B2 (regression of 1d877f2): an unset nats_url outside development is a validator notice, not an issue -- an image that validates while it is built has none yet, and every build failed. B3: the periodic health job runs late instead of being dropped (misfire_grace_time=None, coalesce); dropped runs kept the first startup verdict for 96-217 s. A refresh at the end of startup was tried and withdrawn: it paused agents whose subscriptions were still being made. B4 (owner decision: a fixed default): nats_nak_delay, default 1/5/15/30/60 s per redelivery, 0 for the old behaviour; all attempts used to be spent within 0.3 s. A degraded agent's hand-back stays immediate. This also fixes the pre-existing test_the_broker_counts_it_as_a_redelivery. Live in WSL, against 33fb329 as control: first redelivery after 0.00 s before, 1 s and 5 s now; publish to a tenant subject 200 before, 403 now; asbs validate exit 1 before, 0 with a notice now. Integration 73 of 73. Plan: docs/plans/2026-10-16-pr96-review-fixes.md, step 23. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR Review (re-review): feat: multi-agent grouping (0.9.0) (GitHub #96)Recommendation: Request changes, for two process items (A1, A2). Once those are done: Approve with comments. Short version: the review-fix work is thorough. All three blockers of the 2026-10-15 review are fixed in code, and so are all twelve must-fix items of the 2026-10-16 review, each with a test. I verified this independently by reading the code at
Blocking issuesNone. A · Traceability & B · Story
C · CodeStatus of earlier findings, verified at
Brooks-lint on the delta ( 🟡 Warning
🟢 Suggestion
Conventions:
Tests:
Dependencies (develop → head):
Migration and rollback:
D · Documentation
F · Liability
G · Repository hygiene (default branch
|
| Item | Status |
|---|---|
| README | ✅ Present |
| LICENSE | ❌ Missing (README claims MIT) |
| CODEOWNERS | ❌ Missing |
| SECURITY.md | ❌ Missing |
| CONTRIBUTING | ✅ CONTRIBUTE.md (formatter instructions outdated) |
| CHANGELOG | ✅ Present |
| Secret scanning | ❌ Disabled, including push protection; no CI step. This repo is public. |
| SBOM | ❌ Not generated |
| Dependency updates | ❌ No Dependabot or Renovate; security updates disabled |
| SAST / dependency audit | ❌ None |
| Branch protection | ❌ develop and main unprotected; rulesets exist but are disabled |
Not checked
- Integration tests and live runs (NATS, JetStream, Dapr, Redis, the group image) were not re-run here; there is no broker in this environment and CI doesn't run them.
- The code review is sampled. It covers the
src/delta, not every file. Templates, packaged docs, examples and most test code were not read line by line. Agentbuilder creates unnecessary model (config during init) #4, bug: schedulers start twice (app builder REST-API pass + scheduler pass) — every tick runs twice concurrently #43 and Dapr: declared topics never subscribe, and GET /dapr/subscribe returns 422 to the sidecar #81 were not re-verified. - Secret scanning was pattern-based, because gitleaks and trufflehog are not installed.
- The memory and footprint claims were not measured.
Internal project names were removed from the history of main, develop and this branch: file contents and eight commit messages from 2026-08-24 on, so each of those commits has a new SHA and the release tags moved with them. Author, dates and the files each commit touches are unchanged. This commit points the plans' 18 references to rewritten commits at the new SHAs, records the revised decision D1 and adds the step to the feature changelog. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3c25741 to
c902df1
Compare
The README is also the package description on PyPI, where relative links break. Same form as the badge links in #96, so the two PRs merge cleanly there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the project-name review hook, the replaced-history push guard and the CI job "No replaced history" onto the feature branch. CLAUDE.md: both sides appended sections; kept the branch's sections, then develop's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR Review (delta check): feat: multi-agent grouping (0.9.0) (GitHub #96)Recommendation: Request changes. The conditions of the 2026-10-21 re-review are still open (A1, A2), and the branch now conflicts with What changed since the re-review
Still open
Unchanged from the re-review (not blocking)The 🟡 warnings remain open, because the code has not changed since then:
Not checked
|
The guard let an old-history branch through whenever the command named the repository in double quotes (cd "C:/..." && git push, git -C "..." push) or as cd <dir> followed by a line break: the extracted path kept the JSON-escaped quote or the \n, did not resolve, and an unresolved path is let through. A quoted -C path with a space was not recognised as a push at all. A quoted path is now taken whole and then unquoted, and a line break ends a bare one. Regression tests in tests/unit/hooks run a copy of the hook against a throwaway repository with a replaced root of its own. Of 18 ways to name the repository, the old hook refused 5, the fixed one 18. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…_nak_delay Two points of the 2026-10-21 re-review of #96: item 19 had landed after 21, and the standalone upgrade notes did not say that nats_nak_delay changes redelivery timing for a standalone agent too (with nats_max_deliver = 5, about 50 s to the dead letter instead of a fraction of a second). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The only conflict was the contributing link in README.md: develop still named CONTRIBUTE.md, this branch renames it to CONTRIBUTING.md. Kept CONTRIBUTING.md. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Security Scan job of this PR fails once develop is merged in: bandit reports five Low findings in code that came with #96. - B105 (hardcoded password) x4: both NATS wildcard matchers, subject_is_covered_by() and NATSClient._subject_matches(), named their loop variable `token`, and bandit reads any comparison of a `token` with a string literal ('>', '*') as a password. Renamed to `segment`; no behaviour change. - B101 (assert) x1: Config.resolved_settings() checked a view's loader with an assert, which `python -O` strips, leaving an AttributeError later. It now raises RuntimeError, covered by a new unit test. No nosec comments and no skipped tests: bandit runs clean with the workflow's own settings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Multi-agent grouping
How many agents share a process becomes a deployment parameter rather than an architectural
commitment. An agent's code is identical whether it runs alone or beside nineteen others; only
what starts the process differs. A group of one gives today's process isolation, a group of twenty
gives the shared-interpreter memory profile, and moving an agent between groups changes neither its
broker-side consumer identity nor its telemetry identity.
Today one agent means one process, one port, one broker connection and one image, so a platform of
100 agents pays the ~154 MB Python and library baseline 100 times.
How to review this
389 files, +60,491 / -8,071 against
develop(measured 2026-10-22 on1de7dcd). Please review commit by commit. The firstcommits are milestones from the implementation plan, each squashed from a run of consecutive
commits, so every boundary is a tree state that built and passed. The commits after the first merge of
origin/developaddress the review, one per step ofdocs/plans/2026-10-16-pr96-review-fixes.md;each step names the findings it closes, the tests that hold them and what ran live. Then:
33fb329(step 22): faults no retry can fix fail early, orphaned agents are unhealthy, telemetry and validator parity (D23, D21/N12, N19).17f4033(step 23): the findings of a consuming project's test run on0.9.0a16-- the publish route's 403,nats_nak_delay, the late health job, a validator notice.c902df1: the plans name the commits rewritten on 2026-10-21 (history rewrite to remove internal names).af09ac0: merge oforigin/developwith chore(claude): review every AI commit for project names #108 (project-name review hook, push guard against the replaced history, CI job "No replaced history").5321192: the push guard from chore(claude): review every AI commit for project names #108 let an old-history branch through when the command named the repository in double quotes or followedcd <dir>with a line break; fixed, with regression tests intests/unit/hooks/.1de7dcd: CHANGELOG -- Breaking 18-21 in order,nats_nak_delayin the upgrade notes.src/is identical on17f4033and on the head; everything after it is docs, the merge, the hook and its tests.The single most important reviewer question is invariant C1: an agent's identity must not depend
on which group hosts it. If that is wrong, regrouping becomes a consumer migration and the whole
premise fails. It is pinned by
TestConsumerIdentityIgnoresTheDeploymentintests/unit/agents/clients/io/test_nats_client.py.What a consumer actually gets
Name each agent, where its files are and the module its declaration lives in:
The image contains those agents; the deployment decides which of them a process runs:
python -m blueprint.agents.entrypointresolves, builds and serves. Each hosted agent owns itshandlers, agent runtime, REST routes (
/api/<agent>), AI client, thread pool, caches and brokerconnection; the port, the health endpoints and the process are shared.
Agents in one process are isolated, and the barrier is enforced rather than conventional. An
agent resolves its own components, caches and configuration plus the root's shared ones. Four routes
out of an agent were found and closed -- the registry's bare-name fallback, an explicit
namespace=on a view, a dotted configuration key, and one declaration handing two agents the same mutable
object.
Config.settingsremains the documented escape hatch and logs a WARNING naming the agent.A standalone agent is unaffected by almost all of this. It runs at the root namespace, with the
same registry names, routes, queue group, durable and
service.name. The review fixes restored the0.8 shapes that had broken: a health check named like a built-in one replaces it again, handler
classes and instances register in declaration order, and asyncio debug mode is no longer on by
default in development. What does change for a standalone agent is in Breaking 11-14 below and in the
CHANGELOG's "Upgrading a standalone agent from 0.8".
Breaking changes
The full list, with migrations, is the Breaking section of
[Unreleased]inCHANGELOG.md(the never-released
[0.9.0]section is folded into it). The ones a consumer is most likely to hit:scheduler_modeis required."in_process"reproduces today's behaviour;"event"fixes Scheduler fires duplicate cron ticks under multi-replica/multi-worker deployment #73.app_nameornats_queue_groupfails at startup instead of being rewritten.nats_use_jetstream = trueis enforced against the server; there is no fallback to Core NATS.nats_urlhas no default outside development.standalone agent's default cache keeps its keys.
blueprint.events.unhandledand.duplicatecarryagent, notnamespace; under Dapr anundeclared topic is labelled
<undeclared>.asked for by one redelivers to all; startup warns when such an agent runs without dedup.
AgentRegistration,RegisteredComponent,NamespaceBuilder,with_namespace/with_registration), andClientBase.subscribetakes(topic_callbacks)-- third-party transports are affected.build(), not by thewith_*()call (see "What the code seeschange" in the CHANGELOG).
durable that filters another subject, a stream the server refuses, a missing grant, a refused
login or deliver subject on a named connection. Never retried, logged CRITICAL; at startup the
start fails whatever
critical_agentssays, after itGET /health/liveanswers503(it wasalways
200). A fault that may heal still never fails liveness.readiness_policysays (Breaking 19): an agentlatched down gates readiness under every policy, and one whose resume keeps failing or whose
connection loop gave up (
event_client_max_retries) fails liveness until it consumes again.too:
nats_nak_delaydefaults to 1 s, 5 s, 15 s, 30 s, then 60 s;0restores the immediateredelivery of 0.8.
operator_routes_enabled = false(process scope) leaves the publish and cache routes out. Thedefault stays
true.Rolling back to 0.8 is not free: JetStream durables created by this version, cache entries under
the new keys, grouped REST paths and the new metric labels do not go back by themselves. The
CHANGELOG's "Rolling back to 0.8" section says what to do for each.
Issues
Closes #110
Closes #91
Closes #89
Closes #81
Closes #80
Closes #73
Closes #43
Closes #28
Closes #4
Each verified against the code, not inferred from a commit message:
/status/envreturned credentials in clear; masking now covers userinfo, secret query parameters and path segments, and fails closed.Configpassedcurrent_env=where Dynaconf selects withenv=, so the selected environment never loaded. Fixed here; the scaffolded Dockerfiles select production throughDYNACONF_APP_ENVIRONMENT.GET /dapr/subscribeanswered 422 to the sidecar.tests/integration/was not run and sat at 28 failures. The unit/integration split is enforced; the integration suite has its own compose stack and is run by hand, not in CI.AgentBuilderbuilt a model during__init__; it now resolves everything inbuild().Related, not closed:
marginal RSS per agent this feature exists to produce has not been measured. No benchmark harness
exists.
deployment parameter, Kubernetes runs one Deployment per group -- but the ADR it asks for is
outstanding.
NATSClient, drop its test-only members): review finding W11, follow-up.Licence
This PR adds no licence. The
LICENSEfile added earlier on this branch is removed again, andpyproject.tomlcarries nolicense/license-files: the choice of licence has not been approved bythe responsible owner. Open point for the
develop->mainmerge: the approval, then the licencethere. The alphas already published from this branch (
v0.9.0a1..v0.9.0a15) carry MIT in theirmetadata, which cannot be changed.
README.mdstill states MIT, as ondevelop.Versioning
pyproject.tomlis back atdevelop's0.8.2and the CHANGELOG has only[Unreleased], asAGENTS.mdasks: the publish workflow sets the version from the tag. Follow-up issue, not in thisPR: derive the version from git tags (
setuptools-scm), so source installs report it too.Verification
ruff check src tests1de7dcdruff format --check src tests1de7dcdmypy src1de7dcdpytest tests/unit1de7dcd, CItest_design_rulescase); includes the 35 push-guard tests1de7dcdpytest tests/integration(NATS JetStream, NATS accounts broker, Redis, in WSL)17f4033(src/identical to the head)33fb329200before, one refusal, CRITICAL and liveness503now; a refused grant paused the agent silently before, fails the start now17f4033200before,403now;asbs validateexit 1 before, 0 with a notice now5321192--dry-run, refused and let through as expectedasbs validateagainst the runtimeasbs setup, thencreate_app()and the lifespan in production, as the container doesasbs setup --groupplus two agents, built from the branch, Docker healthhealthyunderBLUEPRINT_AGENTSand under a one-group file. Not repeated after steps 22 and 23.The integration test
test_the_broker_counts_it_as_a_redelivery, which failed before the reviewfixes too, passes since
17f4033: withnats_nak_delaythe attempts are no longer spent before thetest reads
num_redelivered.Known gaps carried forward
atomic across processes. Deduplication and the in-process tick claim need Redis across replicas
or
app_workers; the docs say so.manage_consumer = falsea missing consumer is not detected (CHANGELOG, Known issues).scaffold, whose handler has no event type, so it stays as it is until it is decided what the
generated handler does with one.
tests/integrationdoes not run in CI; it is run by hand against its compose stack.<queue group>.dead-letterwith no consumer; draining it is anoperational task.
CronJobforscheduler_mode = "event"is deferred; the publisher is written byhand.
Raised in the 2026-10-21 re-review, not addressed in this PR (to be decided before a stable
0.9.0, not before the merge into
develop):TenancyErroron one named connection fails liveness for the whole process, so one tenant'srevoked credential restarts every agent and tenant of the pod (D23, to be re-confirmed with this
blast radius).
restart can outlast.
asyncio.to_thread) can leave a marker thatrelease()does notsee, so a redelivery is acked as a duplicate.
agent's tenants; error bodies name subjects and reasons.
NATSClientkeeps growing: Split NATSClient and drop its test-only members (follow-up W11 of #96) #111.How this was made
Much of the code, tests and documentation in this PR -- including the review fixes -- was written
with Claude Code (Anthropic) under the author's direction. Review it as you would any other code;
the generated parts have had no separate security or licence review.
🤖 Generated with Claude Code