Skip to content

feat(provenance): GroundedSignal primitive + AgentSwarm replayable receipt (#822) - #870

Merged
AmitoVrito merged 1 commit into
mainfrom
feat/grounded-signal-822
Jul 31, 2026
Merged

AmitoVrito merged 1 commit into
mainfrom
feat/grounded-signal-822

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Summary

Implements #822 — the GroundedSignal / SignalSource provenance primitive, the correctness keystone for the market/reputation/routing features.

synapsekit.provenance.GroundedSignal (exported at top level) tags any learning-relevant number with who vouched for it: an independent source (EXTERNAL_OVERRIDE) or the agent being scored (SELF_REPORTED). A strict two-tier split with a derived, read-only grounded property — deliberately no middle tier (see the module docstring / issue Design Philosophy #3).

What lands

  • New primitive GroundedSignal + SignalSource (synapsekit/provenance.py), a stateless value type — cheap to ignore, cheap to adopt.
  • AgentSwarm receipt end-to-end: every auction emits a replayable receipt (swarm.trace[-1]) with task_id, each bid's reputation_prior (snapshot + version + grounded_fraction), selected_roles/rejected_roles, budget_allocated/budget_consumed, outcome_score_source, and learning_rule. A winning agent's own estimated_quality can appear as evidence but never marks reputation grounded on its own.
  • Opt-in strict mode: MarketPolicy(require_grounded_reward=True) no-ops the reputation update for an ungrounded outcome. Default is unchanged (skeptical-by-default, enforcement opt-in).
  • Additive, non-breaking: ReputationSnapshot gains version/grounded/grounded_fraction; record_outcome gains an optional quality_signal. Float-only callers untouched. swarm.trace is now indexable and still callable for backward compat.
  • Audit findings documented in-module: CostQualityRouter (not applicable — externally measured) and SelfImprovingAgent (accept gate is grounded via EvalSuite; feedback-provenance tagging is a deferred follow-up).

Tests

  • New tests/test_provenance.py (both source tiers, derived grounded, coercion, frozen immutability, defensive copy, top-level export).
  • tests/agents/test_agent_swarm_receipt.py: xfail removed — the clementineCU spec test now passes, plus tests for the self-reported-can't-ground invariant, external-override grounding, strict-mode no-op vs. default, and trace back-compat.
  • Full suite: 4829 passed, lint + typecheck + async-blocking-gate clean.

Originated from the #734 review discussion with @clementineCU.

Closes #822

…e receipt (#822)

Introduce synapsekit.provenance.GroundedSignal / SignalSource: a small,
stateless value type that tags any learning-relevant number with whether it
came from an independent source (EXTERNAL_OVERRIDE) or was self-reported by the
agent being scored (SELF_REPORTED). Strict two-tier split, derived read-only
`grounded` property, no middle tier.

AgentSwarm uses it end-to-end: every auction now emits a replayable receipt
(swarm.trace[-1]) carrying task_id, each bid's reputation_prior (with version +
grounded_fraction), selected/rejected roles, budget allocated/consumed, the
outcome_score_source, and the learning_rule. A winning agent's own
estimated_quality can appear as evidence but never marks reputation grounded on
its own. Opt-in MarketPolicy(require_grounded_reward=True) no-ops the reputation
update for an ungrounded outcome; default behaviour is unchanged.

ReputationSnapshot gains additive version/grounded/grounded_fraction fields;
Reputation.record_outcome gains an optional quality_signal param (float-only
callers unaffected). swarm.trace is now an indexable sequence that stays
callable for backward compatibility.

Grounding audits documented in-module: CostQualityRouter (not applicable —
inputs are externally measured) and SelfImprovingAgent (accept gate is grounded
via EvalSuite; feedback-provenance tagging is a deferred follow-up).

Originated from a review discussion on #734 with @clementineCU. Non-breaking,
verified against the full suite (4829 passed).

Closes #822

Co-authored-by: Dhruv Garg <[email protected]>
Co-authored-by: Abhay <[email protected]>
@AmitoVrito
AmitoVrito merged commit 0c7df73 into main Jul 31, 2026
18 checks passed
@AmitoVrito
AmitoVrito deleted the feat/grounded-signal-822 branch July 31, 2026 16:27
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.

v2.0.1: GroundedSignal — provenance-tagged reward/quality signal shared across AgentSwarm, CostQualityRouter, SelfImprovingAgent

1 participant