Search by

voku / agent-decision

voku

Provider-neutral bounded decision advice with explicit human authority and privacy boundaries

Package info

github.com/voku/agent-decision

pkg:composer/voku/agent-decision

Statistics

Installs: 17 720

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

0.1.0 2026-11-15 15:42 UTC

README

Status: experimental, released as 0.1.0. agent-loop no longer integrates it. Extracted from agent-loop PR #1044 and issue #646. agent-loop removed that optional integration and its dependency on this package in 0.21.0 (agent-loop#1312); earlier releases such as agent-loop 0.20.113 still depend on it. The integration was removed because the real-provider experiment (#4) was retired without being run. Real-model value is therefore unproven, not disproven. Neither localhost tests nor model confidence demonstrate improved engineering decisions.

Want a model's opinion on a choice without letting the model decide anything? agent-decision is a small, provider-neutral PHP 8.3+ library that returns a bounded, advisory-only recommendation and falls back to your own deterministic baseline whenever anything goes wrong.

You get:

  • Advisory only, always. Every receipt carries authority=advisory_only and lifecycle_mutation=false. Nothing is approved or mutated; your code keeps the decision.
  • Off by default. Mode off makes no network call, uses no provider and discovers no credentials from the environment.
  • Fail-closed and bounded. You define 1–25 options and a baseline; public state is capped at 2000 bytes. Unknown choices, malformed or out-of-range provider output, timeouts and errors all return your baseline, never an invented choice.

Part of Agent Loop — a deterministic, local-first workflow for coding agents: approved Contracts, explicit next actions, evidence before "done". This package owns an experimental, advisory-only bounded-choice helper, currently used by no first-party integration.

Quickstart

Requires PHP ^8.3 and no runtime dependencies.

composer require voku/agent-decision
<?php

declare(strict_types=1);

use voku\AgentDecision\BoundedDecisionAdvisor;
use voku\AgentDecision\DataClassification;
use voku\AgentDecision\DecisionMode;
use voku\AgentDecision\DecisionRequest;

$request = new DecisionRequest(
    criteria: [
        'investigator' => 'Find the relevant owner and evidence.',
        'reviewer' => 'Independently review the current evidence.',
    ],
    publicState: '{"task_type":"public_issue","candidate_count":2}',
    classification: DataClassification::Public,
    baselineChoice: null,
);

// Default is OFF; no network or provider is configured.
$advice = (new BoundedDecisionAdvisor())->advise($request, DecisionMode::Off);
var_export($advice->toArray());

Output:

array (
  'schema_version' => '1.0',
  'authority' => 'advisory_only',
  'lifecycle_mutation' => false,
  'mode' => 'off',
  'disposition' => 'abstain',
  'suggested_choice' => NULL,
  'source' => 'deterministic',
  'provider_disposition' => 'not_enabled',
  'provider_observed_choice' => NULL,
  'provider_probability' => NULL,
  'provider_error' => NULL,
)

With baselineChoice: 'reviewer' and DecisionMode::Rules, the same call returns disposition => 'suggest', suggested_choice => 'reviewer', source => 'deterministic'.

How it works

Mode Provider called? Result
off (default) No Your baseline (or abstain)
rules No Your baseline (or abstain)
shadow Yes, if you inject a DecisionModel and classify the state Public Provider output is observed, your baseline stays the suggestion
assist Yes, same conditions A validated provider choice may become a bounded, non-authoritative hint

DataClassification::Public is your assertion, not a privacy filter: never send private code, paths, diffs or credentials. Details: Concepts, privacy and authority.

Documentation

I want to… Read
Understand the types, modes, limits and privacy rules docs/concepts.md
See the boundaries and how a caller should wire it docs/architecture.md
Know what has and has not been shown docs/evidence-ledger.md
Run the value experiment that was never run docs/experiments.md, docs/first-real-run.md
Contribute or run the checks docs/development.md, AGENTS.md
Browse all docs docs/README.md

Part of the Agent Loop toolchain

Each package owns one concern and can be used on its own. voku/agent-loop composes the workflow packages into one governed workflow; agent-decision is not one of them, since agent-loop removed that integration in 0.21.0.

Package Owns
agent-loop Task Contracts, lifecycle, next actions, validation and review gates
agent-kanban Git-native Markdown board and card semantics
agent-session Per-task working memory, decisions and checkpoints
agent-map Read-only repository symbol maps and typed edit plans
agent-edit Transactional, verified application of edit plans
agent-graph Deterministic SQLite graph index and runtime
agent-recall-compiler Bounded task context (Recall) and prompt recipes
agent-learning Reviewable findings, proposals and durable guidance
agent-skills Portable engineering skills for coding agents
agent-ui Local server-rendered control plane for humans
agent-decision Experimental bounded, advisory-only decision helper
agent-dotfiles Shell dotfiles for non-interactive agent shells

Development

composer install
composer ci   # PHPUnit, PHPStan, PHP-CS-Fixer check

CI also tests the real HTTP adapter against a deterministic local server; see docs/development.md.

License

MIT