Skip to content

feat: add budget-negotiator skill for L3 autonomous negotiation - #400

Merged
cobusgreyling merged 2 commits into
cobusgreyling:mainfrom
THRISHAL12345:feat-budget-negotiator
Jul 29, 2026
Merged

feat: add budget-negotiator skill for L3 autonomous negotiation#400
cobusgreyling merged 2 commits into
cobusgreyling:mainfrom
THRISHAL12345:feat-budget-negotiator

Conversation

@THRISHAL12345

@THRISHAL12345 THRISHAL12345 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces the budget-negotiator skill, allowing L3 autonomous loops to proactively analyze their ROI using structured loop-run-log.md data and formally request a token cap extension from human maintainers instead of silently dying when hitting their limits. Integrated explicitly with loop-budget safety protocols.

Changes

  • New pattern or starter (followed templates/pattern-template.md + updated registry.yaml)
  • Doc / example improvement (New Agent Skill)
  • Tool change (loop-audit)
  • Story (includes real failure or surprise + lesson)

Checklist (from CONTRIBUTING)

  • Links work from README, patterns/README, starters/README, docs/index
  • No secrets, tokens, internal company URLs
  • STATE.md* examples use .example suffix
  • Safety-related content references docs/safety.md
  • Ran node tools/loop-audit/dist/cli.js . (or on the starter) and addressed findings

Testing / Dogfood

  • loop-audit passes on affected starters or this repo
  • Manual review of generated state / skill output

Screenshots / Examples (if UI or command output)

Example Negotiation Output in STATE.md:

[BUDGET NEGOTIATION] I have burned 95k/100k tokens for the 'Daily Triage' loop today. However, I have successfully executed 4 actions with a 'fix-proposed' outcome. There is 1 critical CI failure remaining on the main branch. I request a temporary bump of 'Daily Triage' max tokens/day by +50k to resolve it.

@cobusgreyling cobusgreyling left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Review

Interesting L3 idea (negotiate instead of silent death at the token cap), but the PR is not merge-ready as packaged.

Issue counts

  • bugs / correctness: 2
  • process / checklist: 2
  • suggestions: 3

Must fix

  1. [bug] Conflicts with existing skills/loop-budget without integration
    loop-budget already defines the budget contract: ≥80% → report-only; ≥100% or pause → exit immediately with a one-line STATE note. This skill tells the agent to keep going into negotiation at ≥90% and invent a WAITING_FOR_BUDGET internal state. Without cross-links and an explicit precedence rule (e.g. “budget-negotiator only runs when loop-budget would otherwise hard-exit, and only for High Priority remaining work”), agents will thrash between the two skills.

  2. [bug] Safety / human-gate gaps for L3 content
    CONTRIBUTING requires safety-sensitive content to reference docs/safety.md. Negotiating higher autonomous spend is safety-adjacent (L3 budget expansion). Missing:

    • link to docs/safety.md
    • explicit human must edit loop-budget.md before resume (not just “read it later”)
    • what happens if the human declines (clear the [BUDGET NEGOTIATION] line? keep report-only?)
    • do not allow the agent to self-raise caps
  3. [process] Checklist is inaccurate
    PR body checks “New pattern… + updated registry.yaml” and “All required sections present for patterns” — this is a skill, not a pattern, and registry.yaml is untouched. Please uncheck / correct the checklist so review can trust it.

  4. [process] Discoverability
    Skill is added under skills/budget-negotiator/ and mirrored to templates/SKILL.md.budget-negotiator (good mirror shape), but nothing indexes it: no README/skills index link, no mention from loop-budget skill or docs/operating-loops.md / budget docs. Dead skill files don’t get adopted.

Suggestions

  • De-dupe protocol: template and skill are byte-identical today — fine if install scripts copy template → skill; document that relationship like other skills.
  • ROI metrics: “PRs merged / bugs fixed” is vague vs structured loop-run-log.md fields (actions_taken, outcome, tokens_estimate). Prefer counting log entries for the active pattern today.
  • Cap the ask: e.g. max +20% or +50k per negotiation, one negotiation per day, to avoid runaway bump requests.

Nits

  • Example uses absolute “150k” without tying to loop-budget.md field names.
  • Trailing whitespace on blank lines in the skill body.

Decision: request changes. Integrate with loop-budget, add safety/human-gate language + docs/safety.md link, fix checklist, and link from at least one index or the parent budget skill.

@cobusgreyling

Copy link
Copy Markdown
Owner

Triage status (2026-07-27)

Maintainer triage cycle complete for this PR.

Status: changes requested (see formal review above). Highest-priority follow-ups before re-review:

  1. Integrate / precedence with skills/loop-budget (no conflicting exit vs negotiate rules)
  2. Link docs/safety.md + explicit human edit of loop-budget.md before resume
  3. Fix the PR checklist (this is a skill, not a pattern / no registry.yaml)
  4. Discoverability (link from loop-budget or a skills index)

Happy to re-review once those land.

@cobusgreyling cobusgreyling left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Re-review (post-fix 64b8170)

Must-fix items from the prior review are largely addressed:

  1. Integration with loop-budget — parent skill yields to budget-negotiator at ≥90% when High Priority remains; negotiator documents precedence.
  2. Safety / human gatesdocs/safety.md link, hard ban on self-raising caps, human must edit loop-budget.md, decline path (report-only, no re-ask today), ask capped at +20%/+50k and once/day.
  3. Discoverability — linked from skills/loop-budget/SKILL.md (parent index).

Nits (non-blocking; follow-ups welcome):

  • PR checklist still claims pattern/registry.yaml work — skill-only PRs should mark the skill/template boxes only.
  • HTML “mirror of skills/budget-negotiator” comment is on the skill itself; keep that note on the template only.

Merge. Thanks @THRISHAL12345.

@cobusgreyling
cobusgreyling merged commit 983a6d0 into cobusgreyling:main Jul 29, 2026
2 checks passed
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.

2 participants