Skip to content

Add GoldenDirectiveTermination condition (harmonic relationship score) - #8410

Open
pauleisman-a11y wants to merge 1 commit into
microsoft:mainfrom
pauleisman-a11y:golden-directive-termination
Open

pauleisman-a11y wants to merge 1 commit into
microsoft:mainfrom
pauleisman-a11y:golden-directive-termination

Conversation

@pauleisman-a11y

Copy link
Copy Markdown

Summary

Adds a GoldenDirectiveTermination termination condition to
autogen_agentchat.conditions, implementing the Golden Directive
relationship score as a run-stopping condition:

Y = 2(A x E) / (A + E)

A (agent health) and E (environment health) are supplied by
callables, following the pattern of FunctionalTermination, so the
caller owns how A and E are measured. The condition terminates the
run when the current Y falls below a caller-set min_score, and
exposes the last computed score as last_score.

The Golden Directive (https://thegoldendirective.pages.dev/) is a
candidate training reward proposed by Paul Eisman: A is an agent's
net contribution-health score, floored at 0, designed to be grounded
in resource ledgers; E is the health of everything not-A, against a
healthy baseline. If either A or E reaches 0, Y reaches 0.

Scope, stated plainly:

  • This condition only computes Y from supplied values and stops a
    run below a threshold. It does not measure A or E.
  • It does not implement the spec's full-versus-cropped reporting
    rule, its reversal (E = A Y / (2A - Y)), or its proposed
    fence-patch guardrail.
  • The Directive itself is a proposal, not a deployed or validated
    training method; its results so far are pilot-scale toy
    gridworld runs, reported on the site.

Tests

Added to tests/test_termination_condition.py:

  • Canonical numeric checks from the spec: 8,8 -> 8; 8,7 -> 7.4667
    (about 7.5); 2,3 -> 2.4; A=0 or E=0 -> 0; 1,10 -> 1.8182;
    10,9 -> 9.4737 (A rising enough can still raise Y while E falls);
    negative inputs floored at 0.
  • Behaviour: no termination while Y is at or above the threshold,
    termination with a StopMessage when E drops to 0, reset clears
    the state, async health providers are awaited.

Local run: the full test_termination_condition.py file passes,
15 tests (13 existing + 2 new).

Files changed

  • python/packages/autogen-agentchat/src/autogen_agentchat/conditions/_terminations.py (+119)
  • python/packages/autogen-agentchat/src/autogen_agentchat/conditions/__init__.py (+2)
  • python/packages/autogen-agentchat/tests/test_termination_condition.py (+58)

@pauleisman-a11y

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

1 similar comment
@pauleisman-a11y

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@pauleisman-a11y

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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