diff --git a/CHANGELOG.md b/CHANGELOG.md index 59b072a1..b4fc29d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.16.0] — 2026-08-25 + +### Changed + +- **Descriptive prose removed from the head of the system prompt.** Everything below the + frontmatter in `bundle.md` is loaded verbatim as the session's system instruction, and it is + placed first — ahead of every context file. The shipped manifest carried a title and a + paragraph describing itself there, so every session opened by telling the model a + third-person description of itself instead of an instruction. Only the `@mention` that loads + the principle set remains. Nothing is lost: the same text already lived in the frontmatter + `description` field, which is metadata and is never sent to the model. + +- **Built-in bundle renamed `amplifier-agent-behavioral-anchor` → `amplifier-agent-anchors`.** + This manifest was vendored on 2026-06-17 from amplifier-foundation's + `experiments/behavioral-anchor`; foundation promoted that experiment to the published + `anchors` bundle six days later. This repo kept the pre-promotion name until now. + + The bundle name and its three self-referencing `@mentions` (`:skills`, `:modes`, + `:context/system.md`) move together, along with the name assertion in + `scripts/verify-wheel.py` and the reference in `docs/LAYERS_AND_RELEASES.md`. + + No user-facing behavior change and no wire-protocol change. The prepared-bundle cache key + includes `sha256(bundle.md)`, so existing installs re-resolve the prepared bundle once on + next run — self-healing, no user action required. + +- **`bundle.md` description trimmed to what the manifest needs to declare itself.** It had + accumulated a 60-line narrative: vendoring history, a full upstream-divergence table, and + cache-path detail duplicated from `bundle/__init__.py`. None of it affects how the bundle + loads. The description is now 15 lines and points at the spec for detail. + +- **Upstream divergences documented in `docs/spec/bundle-and-cache.md`,** where the vendored + manifest is already specified, and corrected against the live upstream rather than the + frozen June experiment. Newly recorded: the 9 provider install-stubs and `hooks-routing` + as local additions (upstream has neither); Context Intelligence as a *divergence* rather + than an addition (upstream composes it as two behavior includes as of 2026-08-03 — this + manifest declares the hook module inline and takes the logging half only, so there is no + `session-navigator` agent); and the skills-source divergence (upstream registers the + `amplifier-bundle-skills` skills directory, this manifest vendors a curated subset in the + wheel, so `council-here`, `mass-change`, `session-debug` and roughly 30 other curated + skills are deliberately absent). + ## [0.15.1] — 2026-08-25 ### Fixed diff --git a/docs/LAYERS_AND_RELEASES.md b/docs/LAYERS_AND_RELEASES.md index 50caab55..305b315e 100644 --- a/docs/LAYERS_AND_RELEASES.md +++ b/docs/LAYERS_AND_RELEASES.md @@ -110,7 +110,7 @@ A single Python package containing three internal subpackages: The engine ships with `bundle.md` baked into the wheel. It declares which modules the engine loads at first run. -- **Bundle name:** `amplifier-agent-behavioral-anchor` +- **Bundle name:** `amplifier-agent-anchors` - **Path in repo:** `src/amplifier_agent_lib/bundle/bundle.md` **Pre-wired modules:** diff --git a/docs/spec/bundle-and-cache.md b/docs/spec/bundle-and-cache.md index 1dcac8bf..10b71d53 100644 --- a/docs/spec/bundle-and-cache.md +++ b/docs/spec/bundle-and-cache.md @@ -55,10 +55,47 @@ Agents declare no `tools:` blocks; they inherit the parent tool roster through t `context_inheritance`. Modules referenced only by agent definitions are installed alongside the top-level ones, so a delegated session can always mount what its agent declares. -Four upstream modules are deliberately absent relative to the upstream behavioral-anchor bundle: -`hooks-streaming-ui` and `hooks-todo-display` would break the JSON-stdout contract, -`behaviors/logging.yaml` is replaced by `hook-context-intelligence`, and `hooks-approval` is dropped -because the wire protocol has no approval round-trip yet and policy-driven rules would deadlock. +### Differences from upstream anchors + +This manifest is vendored from `amplifier-foundation@main:bundles/anchors/bundle.md`. Diff against +that file, not against `experiments/behavioral-anchor/` — that experiment was promoted to the +published `anchors` bundle in June 2026 and has not moved since. + +**Added here, absent upstream:** + +| Addition | Why | +|---|---| +| `default_provider: anthropic` | Required by the engine; upstream has no equivalent. See below. | +| 9 provider install-stubs | Upstream declares no providers at all. See the `providers:` note below. | +| `tool-mcp` | Preserves MCP support for existing users. | +| `hooks-routing` | Model-role routing matrix, declared inline rather than included from `@routing-matrix`. | +| 8 vendored skills | `code-review`, `council`, and 6 council lenses, shipped in the wheel. See the skills note below. | + +**Dropped from upstream:** + +| Dropped | Why | +|---|---| +| `hooks-streaming-ui` | Would break the JSON-stdout contract; the engine handles streaming via `bundle/hook_streaming.py`, mounted programmatically by `_runtime.py` and `spawn.py`. | +| `hooks-todo-display` | Same stdout-contract reason. | +| `hooks-approval` | The wire protocol has no approval round-trip yet; policy-driven rules would deadlock. | +| `behaviors/logging.yaml` | `hook-context-intelligence` covers session JSONL capture. | + +**Present in both, but shaped differently:** + +*Context Intelligence.* Upstream has composed it by default since 2026-08-03, as two behavior +includes — logging and navigation. This manifest declares the `hook-context-intelligence` module +inline and takes the logging half only, so there is no `session-navigator` agent here. This +preserves workspace JSONL alignment with amplifier-app-cli per +`docs/designs/2026-06-09-workspace-resolution-and-migration.md` invariant I8. + +*Skills sources.* Upstream registers the `amplifier-bundle-skills` skills directory so that +bundle's `/command` skills resolve. This manifest instead vendors a curated subset inside the wheel, +which `_runtime.py` injects as an absolute path so built-ins win first-match. The consequence is +deliberate: `council-here`, `mass-change`, `session-debug`, and roughly 30 other curated skills are +not available here. + +*Agent names.* Upstream namespaces its roster as `anchors:`; these are bare, because the +definitions are vendored locally. Same six agents. The `providers:` stubs carry NO config and NO credentials. They exist so that every provider module is installed during cold prepare, which matters for `amplifier-agent serve chat-completions`, where diff --git a/pyproject.toml b/pyproject.toml index 8cdf1e4d..5a385e42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = 'amplifier-agent' -version = '0.15.1' +version = '0.16.0' requires-python = '>=3.12' license = 'MIT' dependencies = [ diff --git a/scripts/verify-wheel.py b/scripts/verify-wheel.py index b97794dd..97fe3228 100755 --- a/scripts/verify-wheel.py +++ b/scripts/verify-wheel.py @@ -213,8 +213,8 @@ def check_bundle_md_frontmatter(zf: zipfile.ZipFile) -> str: raise Failure(f"{path} must start with '---\\n' (YAML frontmatter opening delimiter)") if "\n---\n" not in content: raise Failure(f"{path} must contain '\\n---\\n' to close the YAML frontmatter") - if "amplifier-agent-behavioral-anchor" not in content: - raise Failure(f"{path} must declare the bundle name 'amplifier-agent-behavioral-anchor'") + if "amplifier-agent-anchors" not in content: + raise Failure(f"{path} must declare the bundle name 'amplifier-agent-anchors'") if "github.com/microsoft/amplifier-module-" not in content: raise Failure(f"{path} must reference at least one microsoft/amplifier-module by git URL") diff --git a/src/amplifier_agent_lib/bundle/__init__.py b/src/amplifier_agent_lib/bundle/__init__.py index 9d1f80ea..2a95be0e 100644 --- a/src/amplifier_agent_lib/bundle/__init__.py +++ b/src/amplifier_agent_lib/bundle/__init__.py @@ -24,6 +24,6 @@ BUNDLE_MD: Path = BUNDLE_DIR / "bundle.md" #: Directory containing vendored sub-session agent definitions. -#: Current set (behavioral-anchor): explorer, architect, builder, debugger, git-ops, researcher. +#: Current set (anchors): explorer, architect, builder, debugger, git-ops, researcher. #: Per D1 of docs/designs/2026-05-19-baked-in-bundle-decision.md. AGENTS_DIR: Path = BUNDLE_DIR / "agents" diff --git a/src/amplifier_agent_lib/bundle/bundle.md b/src/amplifier_agent_lib/bundle/bundle.md index 576d4576..cea3c2af 100644 --- a/src/amplifier_agent_lib/bundle/bundle.md +++ b/src/amplifier_agent_lib/bundle/bundle.md @@ -1,41 +1,20 @@ --- bundle: - name: amplifier-agent-behavioral-anchor + name: amplifier-agent-anchors version: 0.1.0 description: | - Vendored opinionated manifest for the amplifier-agent CLI. Adapted from - the experimental behavioral-anchor bundle - (amplifier-foundation@main:experiments/behavioral-anchor/behavioral-anchor.md). + Built-in manifest for the amplifier-agent CLI. Vendored from the anchors + bundle (amplifier-foundation@main:bundles/anchors/bundle.md) with + amplifier-agent-specific changes. Behavior is shaped by a small set of named principles loaded once at the head of the system prompt, backed by thin purposeful agents and a standard tool roster inherited by sub-agents through tool-delegate. - AAA-specific modifications from upstream behavioral-anchor: - - default_provider: anthropic (engine reads this directly) - - hook-context-intelligence (preserves workspace JSONL alignment - with amplifier-app-cli, per - docs/designs/2026-06-09-workspace-resolution-and-migration.md - invariant I8) - - tool-mcp (preserves MCP support for existing users) - - DROPPED hooks-streaming-ui (would break JSON-stdout contract; - engine handles streaming via - bundle/hook_streaming.py mounted - programmatically by _runtime.py - and spawn.py) - - DROPPED hooks-todo-display (would break JSON-stdout contract) - - DROPPED behaviors/logging.yaml (replaced by hook-context-intelligence) - - DROPPED hooks-approval (wire protocol has no approval - round-trip yet; would deadlock on - policy-driven rules) + Everything is declared inline -- no `includes:` block -- per + docs/designs/2026-05-19-baked-in-bundle-decision.md. - Per the Strategy 1 decision (docs/designs/2026-05-19-baked-in-bundle-decision.md), - no `includes:` block. Everything declared inline. Manifest text + agent - definitions + context/system.md are vendored inside the wheel; every other - module is git-cloned and pip-installed on first invocation. The prepared - result is cached to - ~/.amplifier-agent/cache/prepared/// - (override the root via $AMPLIFIER_AGENT_HOME). + What differs from upstream anchors, and why: docs/spec/bundle-and-cache.md. Editing this file changes the cache key (sha256) and self-invalidates the warm pickle. @@ -94,7 +73,7 @@ session: auto_compact: true provider: - # NOTE: intentional divergence from upstream behavioral-anchor.md (which + # NOTE: intentional divergence from upstream anchors (which # has no provider block). This entry is the RUNTIME default: when # host_config does not specify a provider, _read_bundle_default_provider() # returns "anthropic" from the top-level `default_provider:` field and @@ -144,7 +123,7 @@ tools: # specialist layer if they re-acquire tool-delegate themselves. exclude_tools: [tool-delegate] - # MCP (AAA-specific addition vs upstream behavioral-anchor) + # MCP (added here; not in upstream anchors) - module: tool-mcp source: git+https://github.com/microsoft/amplifier-module-tool-mcp@main config: @@ -161,7 +140,7 @@ tools: # @mention resolution for a vendored skills dir in module config is # best-effort; the runtime injects the absolute BUNDLE_DIR/skills path, # which is the reliable one. - - "@amplifier-agent-behavioral-anchor:skills" + - "@amplifier-agent-anchors:skills" visibility: enabled: false @@ -184,7 +163,7 @@ tools: session_dir: ~/.amplifier-agent/state/projects/{project}/recipe-sessions auto_cleanup_days: 7 -# Hooks declared inline. AAA-specific modifications from upstream behavioral-anchor: +# Hooks declared inline. Changes from upstream anchors: # - DROPPED hooks-streaming-ui (stdout contract violation; engine uses bundle/hook_streaming.py) # - DROPPED hooks-todo-display (stdout contract violation) # - DROPPED behaviors/logging.yaml include (replaced by hook-context-intelligence below) @@ -227,7 +206,7 @@ hooks: # best-effort; the runtime injects the absolute BUNDLE_DIR/modes path, # which is the reliable one. search_paths: - - "@amplifier-agent-behavioral-anchor:modes" + - "@amplifier-agent-anchors:modes" # === Model routing === # Resolves each agent's model_role frontmatter against a curated provider/model @@ -276,4 +255,4 @@ agents: - researcher --- -@amplifier-agent-behavioral-anchor:context/system.md +@amplifier-agent-anchors:context/system.md diff --git a/uv.lock b/uv.lock index 6e4b4bda..3edf6835 100644 --- a/uv.lock +++ b/uv.lock @@ -16,7 +16,7 @@ members = [ [[package]] name = "amplifier-agent" -version = "0.15.1" +version = "0.16.0" source = { editable = "." } dependencies = [ { name = "amplifier-foundation" },