Skip to content

feat: explicit agent attribution and recorded spend changes - #85

Merged
kwisatzh merged 7 commits into
mainfrom
feat/agent-attribution
Oct 29, 2026
Merged

kwisatzh merged 7 commits into
mainfrom
feat/agent-attribution

Conversation

@kwisatzh

@kwisatzh kwisatzh commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add explicit agent attribution from LiteLLM agent_id or prefixed request tags on LiteLLM and Langfuse. Deduplicate identical suffixes, track empty suffixes, and partition known/unknown/ambiguous rows without splitting accounting.
  • Add opt-in request_tags transport through the shared psql/native projection, with optional read-only column grants, pinned JSONB schema validation and all-tag disclosure. Preserve default projections and reports.
  • Add a versioned, bounded exact agent table with recorded USD, signed recorded-spend-change ordering, cost coverage and period shares. Require show-labels plus acknowledge-sensitive-labels for selected raw agent labels; identity rankings stay aliased.

Verification

Local verification uses nice 10, GOMAXPROCS=1 and serial package builds/tests. No local Docker services or external model calls.

  • Full offline Go suite and race-enabled suite, followed by affected-package checks for final adjustments.
  • go vet ./...
  • Built-CLI file, privacy, source-format and database-adapter parity tests.
  • Ten unchanged text/JSON reports match the verified released v0.13.1 binary byte-for-byte.
  • Offline Python acceptance: 74 tests, 33 passed and 41 runtime/legacy checks skipped locally; pinned database checks run in hosted CI.
  • Synthetic three-agent, 620-token/$6.20 partition, repeated/empty/ambiguous tags, 94% share, missing cost, cardinality and large exact-decimal aggregate cases.
  • Historical captured row-coverage CSVs and provenance remain unchanged; their original source bytes are retained in a checked source archive. Current native/psql parity is tested separately.
  • Hosted pinned database checks must pass on the final head, including exact tag-export bytes, optional grants/schema and actual database/file agent-report parity.

Review And Release

CI follow-ups update the restricted-network smoke invocation for the second
disclosure flag and add three agent cases. The packaged SQL verification step
has a bounded 15-minute allowance including pinned image pulls: the full suite
already completed with 67 passes and seven optional skips, but exceeded the old
ten-minute step budget. No cases or assertions were removed. The published
calibration-bound ci.yml remains byte-identical, and job-wide limits plus all
publication triggers and conditions are unchanged.

Draft for Claude review before merge. Merge only after that review and green final-head checks. No release, tag or installer-pin update in this PR. The new feature documentation is explicitly unreleased.

Compose bounded exact agent accounting with existing request accounting. Add shared opt-in request-tag transport, project-scoped Langfuse attribution, distinct-suffix coverage, sensitive-label acknowledgement, and frozen-source fixture provenance. Preserve default reports, projections, collector summaries and base accounting.

Code authors: Vijay and Codex

Signed-off-by: Vijay <evijay@gmail.com>
Use both disclosure flags in the routing smoke command and exercise agent ID, tag partitions and selected label disclosure with and without networking. Code authors: Vijay and Codex.

Signed-off-by: Vijay <evijay@gmail.com>
Keep all assertions and cases. Allow fifteen minutes for the hosted SQL steps including pinned image pulls; retain existing job-wide limits. Clarify that the new tag transport and two-flag disclosure target the next minor, not the released v0.13.1 binary. No trigger or publication condition changes. Code authors: Vijay and Codex.

Signed-off-by: Vijay <evijay@gmail.com>
Restore ci.yml exactly to the published manifest. Main CI already passed its existing SQL limit; only packaged verification retains the bounded fifteen-minute allowance. Leave all calibration evidence and assertions unchanged. Code authors: Vijay and Codex.

Signed-off-by: Vijay <evijay@gmail.com>
Signed-off-by: Vijay <evijay@gmail.com>
Signed-off-by: Vijay <evijay@gmail.com>
Signed-off-by: Vijay <evijay@gmail.com>
@kwisatzh
kwisatzh marked this pull request as ready for review October 29, 2026 23:21
@kwisatzh
kwisatzh merged commit 64e6a53 into main Oct 29, 2026
18 checks passed
@kwisatzh
kwisatzh deleted the feat/agent-attribution branch October 29, 2026 23:29
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