Skip to content

feat(engine): engine-probed capability manifest + pre-launch gate (issue #5 proposal 3) - #11

Merged
askclaw-vesper merged 2 commits into
mainfrom
feat/capability-manifest
Aug 20, 2026
Merged

askclaw-vesper merged 2 commits into
mainfrom
feat/capability-manifest

Conversation

@askclaw-vesper

Copy link
Copy Markdown
Collaborator

Implements issue #5, proposal 3 (engine-detected adapter capability manifest). Stacked on #10 — merge order: #10, then this.

Design (per the proposal's hard constraints)

  • Controlled vocabularyconfig.KNOWN_CAPABILITIES; unknown entries fail definition load. v1 entries, each verified against the real CLI:
    • cli-version: <cli> --version exits 0 (all adapters with a version argv).
    • one-shot-source-tagging (hermes-cli): <cli> chat --help shows -q / --source / --pass-session-id — probe shape verified against real Hermes v0.20.4.
  • Engine-probed, never adapter self-report — the adapter only names argv + check; the engine runs the probe (bounded, under the actor's settings env) and records the outcome.
  • Pre-launch gaterunner.launch probes required capabilities after prepare and refuses before claim, before any runtime spawn with the missing capability named.
  • Hashed into evidence — the manifest (per-capability ok, probe argv, exit status, truncated output, full-output SHA-256) rides in the hashed evidence record as capability_manifest (only when the actor declares requirements, so unchanged turns pay nothing).

Canary (from the proposal)

A stubbed CLI whose chat --help omits --source → launch refused, marker file absent (no spawn), no claim, turn_index 0 (test_missing_capability_refuses_launch_before_any_spawn). Plus: manifest recorded on pass, failing --version fails the gate, and the config-level vocabulary matrix (unknown/duplicate/non-string/default).

Tests

Full suite: 309 passed; scripts/verify.py{"ok": true}.

…sue #5 proposal 3)

Actors may declare required_capabilities from a controlled vocabulary
(config.KNOWN_CAPABILITIES; unknown entries fail definition load).
Before any claim or runtime spawn, the engine probes each required
capability from the CLI itself — never adapter self-report — and
refuses the launch when the probed manifest lacks one. v1 vocabulary:
cli-version (<cli> --version exits 0) and hermes-cli
one-shot-source-tagging (chat --help shows -q/--source/
--pass-session-id, verified against real Hermes v0.20). The manifest
(probe argv, exit, truncated output, full-output hash per capability)
is recorded in the turn evidence as capability_manifest.

Canary: a stub whose chat --help omits --source gets the launch
refused with no claim, no spawn, no ledger commit.
@askclaw-vesper
askclaw-vesper force-pushed the feat/capability-manifest branch from 5705f17 to e169ed9 Compare August 20, 2026 06:26

@adaptcom adaptcom Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confidence Score: 4/5

Summary

Adds an engine-probed capability manifest with a pre-launch gate that refuses before claim or spawn. Fail-closed design, full suite green; remaining risks are robustness and consistency nits, plus the stacked dependency on #10.

Important Files Changed

File Overview
src/multi_agent_dialogue/config.py KNOWN_CAPABILITIES vocabulary and required_capabilities parsing with unknown/duplicate/type validation
src/multi_agent_dialogue/adapters/base.py Bounded probe runner, manifest builder, manifest embedded in evidence record
src/multi_agent_dialogue/adapters/hermes.py chat --help probe for one-shot-source-tagging; loose substring checks
src/multi_agent_dialogue/runner.py Capability gate after prepare, before claim and any spawn
schemas/protocol.schema.json required_capabilities enum duplicated by hand from config vocabulary
schemas/runtime-evidence.schema.json capability_manifest shape with per-capability probe record
examples/fakes/bin/fake-hermes chat --help fixture mirroring real v0.20 surface
docs/technical-reference.md Capability gate documentation
tests/test_config.py Vocabulary matrix: default, known, unknown, duplicate, non-string
tests/test_real_contracts.py Canary: refusal before spawn, no claim, manifest recorded on pass

Re-run review · View in Adapt

Comment thread src/multi_agent_dialogue/runner.py Outdated
Comment thread src/multi_agent_dialogue/adapters/base.py Outdated
Comment thread src/multi_agent_dialogue/adapters/hermes.py Outdated
Comment thread src/multi_agent_dialogue/adapters/base.py Outdated
Comment thread src/multi_agent_dialogue/adapters/base.py Outdated
Comment thread schemas/protocol.schema.json
- gate wraps probe failures into ProtocolError (no raw AdapterError);
- the evidence records the SAME manifest that gated the launch
  (runner attaches it to the frozen context via dataclasses.replace),
  so no divergent re-probe and no probe failure after completion;
- hook AdapterError inside probe_capabilities is caught and recorded
  as manifest hook_error instead of crashing the gate;
- flag checks use exact-token regexes (-q no longer matches --query,
  --source no longer matches --source-map) with a lookalike-flags test;
- probe records gain output_truncated for cli_version parity;
- probe annotation typed Callable[[str, int], bool];
- schema capability enums are pinned to config.KNOWN_CAPABILITIES by a
  cross-check test so they cannot drift.
@askclaw-vesper
askclaw-vesper merged commit 71ac702 into main Aug 20, 2026
2 checks passed
@askclaw-vesper
askclaw-vesper deleted the feat/capability-manifest branch August 20, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant