Skip to content

feat(006): add T075 pure authority evaluator - #76

Merged
TheHalfMoon merged 6 commits into
mainfrom
impl/006-t075-authority-evaluator
Aug 21, 2026
Merged

feat(006): add T075 pure authority evaluator#76
TheHalfMoon merged 6 commits into
mainfrom
impl/006-t075-authority-evaluator

Conversation

@TheHalfMoon

@TheHalfMoon TheHalfMoon commented Aug 21, 2026

Copy link
Copy Markdown
Owner

What changed

T075 only: add a pure, fixture-only authority/delegation evaluator for one Planner -> one Worker relationship.

Changed exactly:

  • src/agentic_authority.rs
  • src/t075_agentic_authority_tests.rs
  • src/main.rs test-only registration

No migration. No dependency change. No Store mutation. No Agent process or prompt. No ACP/MCP/daemon IPC/remote execution. No operation execution or automatic landing.

Canonical base: ad9d5b223f55e78d6db73c69bb5ca076a1da3ea1.
Exact qualified head: 311c92fdf0e35bb58b00ca224a2dab934054a8d5.

Spec Kit traceability

  • Active spec: specs/006-agentic-terminal-local-delegation-control-plane/spec.md
  • Active task: T075 — Pure authority/delegation evaluator
  • Plan/tasks updated if scope changed: [x] N/A — authorized scope did not change
  • Acceptance scenarios proven: [x]

Deterministic exact-head evidence

  • quality #702 / run 32508355226 — SUCCESS
  • windows-terminal #408 / run 32508355223 — SUCCESS
  • release-candidate #469 / run 32508355215 — SUCCESS
  • cargo fmt --all -- --check
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --locked --all-targets --all-features
  • T075 focused tests registered and executed — 12/12 PASS

Review stack

  • Author correctness/safety/evidence-integrity review — PASS
  • Ponytail/YAGNI review — PASS
  • Qodo independent exact-head review — PASS / no material findings
  • CodeRabbit exact-head review — no actionable comments / merge risk Minimal
  • External findings reconciled
  • Unresolved material findings = 0
  • Unresolved review threads = 0

External-review reconciliation

CodeRabbit's only warning was generic docstring coverage (60% vs 80%). Classified NON_MATERIAL / NO_CHANGE: T075 is a private/test-only fixture proof surface, canonical acceptance does not require docstring coverage, all Rust/CI gates pass, and adding documentation-only churn solely for a generic bot metric would violate the accepted YAGNI posture.

Winds safety invariants

  • Planner direct authority is represented separately from delegation ceiling
  • Worker effective authority is bounded by Worker grant ∩ Planner delegation ceiling ∩ team policy ∩ human ceiling
  • Explicit deny precedence is fail-closed
  • Planner cannot use the Worker request path to self-escalate
  • Repository/model/tool/imported text is inert authority data and cannot self-escalate
  • Visibility is not authorization
  • WINDS_ENFORCED cannot survive without complete Winds mediation evidence
  • Evaluator returns decision/reason/human-action and performs no operation
  • One Planner -> one Worker topology only
  • No automatic winner/merge/rebase/push behavior introduced
T074=CLOSED_CANONICAL
T075=QUALIFIED_EXACT_HEAD_READY_FOR_GUARDED_MERGE
T076=BLOCKED_UNTIL_T075_CLOSED_CANONICAL
REAL_CODEX_PROMPT=BLOCKED_UNTIL_T079
REAL_CLAUDE_PROMPT=BLOCKED_UNTIL_T080
AGENT_EXECUTION=NO
PROMPT_SENT=NO
MIGRATION_ADDED=NO
DEPENDENCY_CHANGE=NO
STORE_MUTATION=NO
ACP=NO
MCP=NO
DAEMON_IPC=NO
REMOTE_EXECUTION=NO
AUTOMATIC_LANDING=NO

Any candidate-head movement invalidates this qualification and requires fresh exact-head gates and review before merge.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bb5fa3ce-b2cf-49b4-a505-e486f66e0801

📥 Commits

Reviewing files that changed from the base of the PR and between ad9d5b2 and 311c92f.

📒 Files selected for processing (3)
  • src/agentic_authority.rs
  • src/main.rs
  • src/t075_agentic_authority_tests.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Adds a crate-visible delegation authority model and evaluator. The evaluator checks authority planes, worker identity, topology, enforcement evidence, visibility, and untrusted text. New tests cover precedence, fail-closed behavior, determinism, and contract immutability.

Changes

Delegation authority

Layer / File(s) Summary
Authority contracts
src/agentic_authority.rs
Defines authority decisions, targets, planes, worker grants, delegation contracts, requests, enforcement evidence, visibility, evaluation reasons, and human actions.
Delegation evaluation
src/agentic_authority.rs
evaluate_delegation validates topology and worker identity, applies denial and approval precedence, checks enforcement evidence, records visibility, and ignores untrusted authority text.
Authority validation
src/main.rs, src/t075_agentic_authority_tests.rs
Registers the test modules and validates authority separation, policy precedence, fail-closed behavior, enforcement quality, topology, determinism, and contract immutability.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 311c9

This PR adds a test-only, pure authority evaluator without changing runtime behavior, dependencies, persistence, or operation execution. No actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant AuthorityRequest
  participant evaluate_delegation
  participant DelegationContract
  participant AuthorityEvaluation
  AuthorityRequest->>evaluate_delegation: submit request
  evaluate_delegation->>DelegationContract: inspect grants and policy ceilings
  evaluate_delegation->>AuthorityEvaluation: record decision, visibility, and human action
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the feature and its T075 pure authority evaluator scope.
Description check ✅ Passed The description covers the required change summary, traceability, evidence, review status, safety invariants, and findings.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch impl/006-t075-authority-evaluator

Comment @coderabbitai help to get the list of available commands.

@TheHalfMoon
TheHalfMoon marked this pull request as ready for review August 21, 2026 17:40

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Please review the current exact candidate head 311c92fdf0e35bb58b00ca224a2dab934054a8d5. Prior review was skipped only because the PR was Draft; it is now Ready for review.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

@TheHalfMoon I will review pull request #76 at commit 311c92fdf0e35bb58b00ca224a2dab934054a8d5.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add T075 pure authority/delegation evaluator (fixture-only) with proofs

✨ Enhancement 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Add a pure authority/delegation evaluator for single Planner � single Worker topology (T075).
• Encode fail-closed rules: explicit deny precedence, approval gating, and enforcement evidence
 checks.
• Add focused unit tests proving invariants and register them in the test build.
Diagram

graph TD
  A["AuthorityRequest"] --> B["evaluate_delegation()"] --> C{"Single worker?"}
  C -- "no" --> O1["AuthorityEvaluation: Deny (InvalidTopology)"]
  C -- "yes" --> D{"Worker matches contract?"}
  D -- "no" --> O2["AuthorityEvaluation: Deny (UnknownWorker/Topology)"]
  D -- "yes" --> E{"Any plane Deny?"}
  E -- "yes" --> O3["AuthorityEvaluation: Deny (ExplicitDeny)"]
  E -- "no" --> F{"Any plane Ask?"}
  F -- "yes" --> O4["AuthorityEvaluation: Ask (ApprovalRequired)"]
  F -- "no" --> G{"Enforcement available?"}
  G -- "no" --> O5["AuthorityEvaluation: Ask (EnforcementUnproven)"]
  G -- "yes" --> O6["AuthorityEvaluation: Allow"]
  H["DelegationContract (4 planes)"] --> B
  I["truthful_enforcement()"] --> B
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use a dedicated policy engine (e.g., Cedar/OPA)
  • ➕ Richer expressiveness (conditions, wildcards, principals)
  • ➕ Potentially reusable across future tasks beyond T075
  • ➖ Adds dependencies and complexity contrary to fixture-only intent
  • ➖ Harder to keep deterministic/transparent for safety-invariant proofs
2. Encode authority as a normalized lattice/bitset model
  • ➕ Very explicit intersection semantics; easier to reason about completeness
  • ➕ Potentially faster and less allocation-heavy than string targets
  • ➖ Less flexible for arbitrary capability/resource strings used in specs
  • ➖ More upfront modeling work for a test-only evaluator

Recommendation: Keep the PR�s current approach: a small, pure Rust evaluator with explicit precedence rules and diagnostic-rich output. It best matches T075�s fixture-only, deterministic proof goal without introducing dependencies or hidden policy semantics.

Files changed (3) +546 / -0

Enhancement (1) +248 / -0
agentic_authority.rsAdd pure delegation/authority evaluator and supporting policy types +248/-0

Add pure delegation/authority evaluator and supporting policy types

• Introduces policy data structures (authority planes, worker grants, delegation contract) and a pure 'evaluate_delegation' function. The evaluator is fail-closed on topology/unknown worker, enforces deny/ask precedence across four planes, and validates Winds enforcement claims via 'truthful_enforcement'.

src/agentic_authority.rs

Tests (1) +294 / -0
t075_agentic_authority_tests.rsAdd T075 proofs for authority boundaries and enforcement invariants +294/-0

Add T075 proofs for authority boundaries and enforcement invariants

• Adds unit tests validating the evaluator s safety invariants: independent planner direct authority vs delegation ceiling, explicit deny precedence, intersection semantics across all planes, fail-closed unknown worker/topology behavior, visibility not implying authorization, untrusted text being inert, and Winds mediation requirements.

src/t075_agentic_authority_tests.rs

Other (1) +4 / -0
main.rsRegister T075 authority module and tests under cfg(test) +4/-0

Register T075 authority module and tests under cfg(test)

• Adds 'agentic_authority' and 't075_agentic_authority_tests' modules behind '#[cfg(test)]' so the evaluator and proofs compile/run only in test builds.

src/main.rs

Copy link
Copy Markdown
Owner Author

T075 exact-head author qualification

EXACT_HEAD=311c92fdf0e35bb58b00ca224a2dab934054a8d5
CANONICAL_BASE=ad9d5b223f55e78d6db73c69bb5ca076a1da3ea1
CHANGED_FILES=3
QUALITY_RUN=32508355226 / #702 / SUCCESS
WINDOWS_TERMINAL_RUN=32508355223 / #408 / SUCCESS
RELEASE_CANDIDATE_RUN=32508355215 / #469 / SUCCESS
T075_FOCUSED_TESTS=12/12 PASS
AUTHOR_CORRECTNESS_SAFETY_REVIEW=PASS
PONYTAIL_YAGNI_REVIEW=PASS
INDEPENDENT_REVIEW=PENDING
UNRESOLVED_MATERIAL_FINDINGS=PENDING_EXTERNAL_REVIEW
MERGE_AUTHORIZED=NO

Author correctness / safety / evidence-integrity verdict — PASS

  • Planner direct authority and delegation ceiling remain separate.
  • Worker effective authority is bounded by Worker grant ∩ Planner delegation ceiling ∩ team policy ∩ human ceiling.
  • Deny precedence is fail-closed.
  • Planner cannot use the Worker request path to self-escalate.
  • Repository/model/tool/imported text remains inert authority data.
  • Visibility is explicitly not authorization.
  • WINDS_ENFORCED is downgraded when complete Winds mediation is not proven.
  • The evaluator is pure and performs no operation.
  • One Planner -> one Worker topology is enforced.
  • No Agent execution, prompt, migration, dependency, Store mutation, ACP, MCP, daemon IPC, remote execution, or automatic landing was introduced.

Ponytail / YAGNI verdict — PASS

The implementation stays inside the T075 slice: one pure module, one focused test module, and test-only crate registration. It does not pre-build T076 approval persistence/digests, T077/T078 protocol clients, runtime execution, recursive fleets, generic policy engines, or persistence abstractions.

Independent exact-head review remains required before merge. Any head movement invalidates this qualification and requires exact-head gates/review to be rerun.

Copy link
Copy Markdown
Owner Author

T075 external-review reconciliation — exact head

EXACT_HEAD=311c92fdf0e35bb58b00ca224a2dab934054a8d5
QODO_REVIEW=PASS_NO_MATERIAL_FINDINGS
CODERABBIT_REVIEW=PASS_NO_ACTIONABLE_COMMENTS
CODERABBIT_MERGE_RISK=MINIMAL
UNRESOLVED_REVIEW_THREADS=0
DOCSTRING_COVERAGE_WARNING=NON_MATERIAL_NO_CHANGE
INDEPENDENT_EXACT_HEAD_REVIEW=PASS
UNRESOLVED_MATERIAL_FINDINGS=0

Reconciliation

Qodo reviewed the T075 slice and recommended retaining the current small, pure evaluator approach as the best fit for the fixture-only deterministic proof goal. CodeRabbit reviewed the same exact base-to-head range and generated no actionable comments, rating merge risk Minimal.

CodeRabbit also reported a docstring-coverage warning (60% vs its generic 80% threshold). This is classified NON_MATERIAL / NO_CHANGE because:

  • T075 authorizes a private/test-only fixture proof surface, not a public API or documentation expansion;
  • the canonical T075 acceptance criteria contain no docstring-coverage requirement;
  • cargo fmt, clippy -D warnings, full tests, focused T075 tests, Windows-terminal, and release-candidate gates are green on the exact head;
  • adding docstrings solely to satisfy a generic bot metric would create non-functional churn contrary to the accepted Ponytail/YAGNI review.

No review thread is unresolved. No code/head mutation is required from external review. Any subsequent head movement invalidates this reconciliation and requires fresh exact-head qualification.

@TheHalfMoon
TheHalfMoon merged commit 979d130 into main Aug 21, 2026
19 checks passed
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Missing rule can allow 🐞 Bug ⛨ Security
Description
AuthorityPlane::decision_for falls back to default_decision, so if any plane is constructed with
default_decision=Allow, an unspecified (missing-scope) target can be authorized, violating
fail-closed expectations. This creates a silent privilege escalation path driven by configuration
rather than explicit rules.
Code

src/agentic_authority.rs[R24-27]

+        self.rules
+            .get(target)
+            .copied()
+            .unwrap_or(self.default_decision)
Relevance

●●● Strong

Fail-closed authority is a stated invariant; missing-scope Allow via default_decision contradicts
spec intent.

PR-#74
PR-#73

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The evaluator’s plane lookup explicitly falls back to default_decision, and
evaluate_delegation() relies on those lookups for all four bounding planes; therefore an Allow
default turns “missing scope” into an allow. The spec acceptance criteria emphasize fail-closed
authority evaluation, so allowing implicit authorization via default is inconsistent with the
intended safety model.

src/agentic_authority.rs[22-28]
src/agentic_authority.rs[178-195]
specs/006-agentic-terminal-local-delegation-control-plane/tasks.md[193-211]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`AuthorityPlane::decision_for()` uses `unwrap_or(self.default_decision)`. That means a caller can accidentally (or maliciously, if contracts become derived from partially untrusted config later) set `default_decision=Allow` and get an implicit allow for targets not explicitly present in the rules map.

This conflicts with the spec’s “fail closed” posture for authority evaluation and undermines the test `missing_scope_fails_closed_instead_of_inheriting_visibility_or_prose`, which currently only passes because the fixtures set `default_decision=Deny`.

## Issue Context
The evaluator is meant to be a pure authority evaluator; it should be robustly fail-closed and not depend on “callers remembered to set defaults to deny” to maintain safety.

## Fix Focus Areas
- src/agentic_authority.rs[22-28]
- src/agentic_authority.rs[178-195]

## Suggested fix
Choose one of these approaches (prefer A):

A) Remove `default_decision` from authorization semantics for this evaluator and always treat missing rules as `Deny` (fail-closed). For example, change `decision_for` to `self.rules.get(target).copied().unwrap_or(AuthorityDecision::Deny)`.

B) Keep `default_decision` but add explicit validation in `evaluate_delegation()` that all planes involved in delegation have `default_decision == Deny`. If any plane has a non-deny default, return `Deny` (or `Ask`, depending on desired UX) with a reason like `ApprovalRequired`/a new `UnsafePolicyDefault` and a clear `HumanAction::ChangeProtectedPolicy`.

Also add a test that constructs a plane with `default_decision=Allow` and a request for an unmapped target, and assert the decision remains fail-closed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Wrong action for self-loop 🐞 Bug ≡ Correctness
Description
When a worker is invalid because worker.worker_id == contract.planner_id, the evaluator returns
HumanAction::ReduceToSingleWorker, which cannot remediate a self-loop (it’s already a single
worker). This will mislead operators/tests about the corrective action needed for that invalid
topology.
Code

src/agentic_authority.rs[R160-165]

+    if worker.parent_planner_id != contract.planner_id || worker.worker_id == contract.planner_id {
+        return make_evaluation(
+            AuthorityDecision::Deny,
+            AuthorityReason::InvalidTopology,
+            HumanAction::ReduceToSingleWorker,
+            Vec::new(),
Relevance

●●● Strong

Self-loop can't be remediated by ReduceToSingleWorker; correctness bug, team tends to accept such
fixes.

PR-#74
PR-#73

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The invalid-topology check explicitly treats the self-loop (`worker.worker_id ==
contract.planner_id) as requiring ReduceToSingleWorker`, but that action is ineffective in a
topology that already has exactly one worker and needs identity separation instead.

src/agentic_authority.rs[150-167]
specs/006-agentic-terminal-local-delegation-control-plane/tasks.md[201-211]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The invalid-topology branch conflates multiple topology failures under `HumanAction::ReduceToSingleWorker`. In particular, `worker.worker_id == contract.planner_id` indicates a self-loop (planner acting as worker), which is not fixable by reducing to a single worker.

## Issue Context
This evaluator returns a human action meant to guide remediation. For correctness and safety workflows, that action should be specific enough that following it can actually fix the problem.

## Fix Focus Areas
- src/agentic_authority.rs[159-167]

## Suggested fix
Split the combined condition:
- If `contract.workers.len() != 1`: keep `ReduceToSingleWorker`.
- If `worker.parent_planner_id != contract.planner_id`: return an action that indicates fixing parent/relationship (either introduce a new `HumanAction::FixPlannerWorkerRelationship` or reuse `ChangeProtectedPolicy` if that’s the intended remediation bucket).
- If `worker.worker_id == contract.planner_id`: return `SelectAuthorizedWorker` (or a new more specific action like `SeparatePlannerAndWorkerIdentity`).

Add/adjust a focused test case for the self-loop topology to assert the updated `human_action`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 12 rules
Review mode: ⚖️ Balanced: This adds substantial new authorization logic with multiple fail-closed and enforcement paths; despite being test-only and localized, its security-sensitive semantics warrant a careful single-pass review.

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display preferences with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/agentic_authority.rs
Comment on lines +24 to +27
self.rules
.get(target)
.copied()
.unwrap_or(self.default_decision)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Missing rule can allow 🐞 Bug ⛨ Security

AuthorityPlane::decision_for falls back to default_decision, so if any plane is constructed with
default_decision=Allow, an unspecified (missing-scope) target can be authorized, violating
fail-closed expectations. This creates a silent privilege escalation path driven by configuration
rather than explicit rules.
Agent Prompt
## Issue description
`AuthorityPlane::decision_for()` uses `unwrap_or(self.default_decision)`. That means a caller can accidentally (or maliciously, if contracts become derived from partially untrusted config later) set `default_decision=Allow` and get an implicit allow for targets not explicitly present in the rules map.

This conflicts with the spec’s “fail closed” posture for authority evaluation and undermines the test `missing_scope_fails_closed_instead_of_inheriting_visibility_or_prose`, which currently only passes because the fixtures set `default_decision=Deny`.

## Issue Context
The evaluator is meant to be a pure authority evaluator; it should be robustly fail-closed and not depend on “callers remembered to set defaults to deny” to maintain safety.

## Fix Focus Areas
- src/agentic_authority.rs[22-28]
- src/agentic_authority.rs[178-195]

## Suggested fix
Choose one of these approaches (prefer A):

A) Remove `default_decision` from authorization semantics for this evaluator and always treat missing rules as `Deny` (fail-closed). For example, change `decision_for` to `self.rules.get(target).copied().unwrap_or(AuthorityDecision::Deny)`.

B) Keep `default_decision` but add explicit validation in `evaluate_delegation()` that all planes involved in delegation have `default_decision == Deny`. If any plane has a non-deny default, return `Deny` (or `Ask`, depending on desired UX) with a reason like `ApprovalRequired`/a new `UnsafePolicyDefault` and a clear `HumanAction::ChangeProtectedPolicy`.

Also add a test that constructs a plane with `default_decision=Allow` and a request for an unmapped target, and assert the decision remains fail-closed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread src/agentic_authority.rs
Comment on lines +160 to +165
if worker.parent_planner_id != contract.planner_id || worker.worker_id == contract.planner_id {
return make_evaluation(
AuthorityDecision::Deny,
AuthorityReason::InvalidTopology,
HumanAction::ReduceToSingleWorker,
Vec::new(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Wrong action for self-loop 🐞 Bug ≡ Correctness

When a worker is invalid because worker.worker_id == contract.planner_id, the evaluator returns
HumanAction::ReduceToSingleWorker, which cannot remediate a self-loop (it’s already a single
worker). This will mislead operators/tests about the corrective action needed for that invalid
topology.
Agent Prompt
## Issue description
The invalid-topology branch conflates multiple topology failures under `HumanAction::ReduceToSingleWorker`. In particular, `worker.worker_id == contract.planner_id` indicates a self-loop (planner acting as worker), which is not fixable by reducing to a single worker.

## Issue Context
This evaluator returns a human action meant to guide remediation. For correctness and safety workflows, that action should be specific enough that following it can actually fix the problem.

## Fix Focus Areas
- src/agentic_authority.rs[159-167]

## Suggested fix
Split the combined condition:
- If `contract.workers.len() != 1`: keep `ReduceToSingleWorker`.
- If `worker.parent_planner_id != contract.planner_id`: return an action that indicates fixing parent/relationship (either introduce a new `HumanAction::FixPlannerWorkerRelationship` or reuse `ChangeProtectedPolicy` if that’s the intended remediation bucket).
- If `worker.worker_id == contract.planner_id`: return `SelectAuthorizedWorker` (or a new more specific action like `SeparatePlannerAndWorkerIdentity`).

Add/adjust a focused test case for the self-loop topology to assert the updated `human_action`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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