Repository navigation
feat(provenance): GroundedSignal primitive + AgentSwarm replayable receipt (#822) - #870
Merged
Merged
Conversation
…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]>
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #822 — the
GroundedSignal/SignalSourceprovenance 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-onlygroundedproperty — deliberately no middle tier (see the module docstring / issue Design Philosophy #3).What lands
GroundedSignal+SignalSource(synapsekit/provenance.py), a stateless value type — cheap to ignore, cheap to adopt.AgentSwarmreceipt end-to-end: every auction emits a replayable receipt (swarm.trace[-1]) withtask_id, each bid'sreputation_prior(snapshot +version+grounded_fraction),selected_roles/rejected_roles,budget_allocated/budget_consumed,outcome_score_source, andlearning_rule. A winning agent's ownestimated_qualitycan appear as evidence but never marks reputation grounded on its own.MarketPolicy(require_grounded_reward=True)no-ops the reputation update for an ungrounded outcome. Default is unchanged (skeptical-by-default, enforcement opt-in).ReputationSnapshotgainsversion/grounded/grounded_fraction;record_outcomegains an optionalquality_signal. Float-only callers untouched.swarm.traceis now indexable and still callable for backward compat.CostQualityRouter(not applicable — externally measured) andSelfImprovingAgent(accept gate is grounded viaEvalSuite; feedback-provenance tagging is a deferred follow-up).Tests
tests/test_provenance.py(both source tiers, derivedgrounded, 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.Originated from the #734 review discussion with @clementineCU.
Closes #822