Skip to content

Add JSON tags to ledger totals - #35

Merged
prashar32 merged 1 commit into
prashar32:mainfrom
yzhkali:fix/audit-totals-json-tags
Jun 1, 2026
Merged

Add JSON tags to ledger totals#35
prashar32 merged 1 commit into
prashar32:mainfrom
yzhkali:fix/audit-totals-json-tags

Conversation

@yzhkali

@yzhkali yzhkali commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add JSON tags to LedgerTotals so audit export totals use API-style field names
  • add coverage to reject Go field names in the marshaled totals payload

Closes #30

Tests

  • go test ./internal/storage
  • go test ./...

@yzhkali
yzhkali requested a review from prashar32 as a code owner May 31, 2026 13:30
prashar32 added a commit that referenced this pull request May 31, 2026
GitHub doesn't expose repo secrets (CLAUDE_CODE_OAUTH_TOKEN) to PRs from forks,
so the review action can't authenticate and the job always fails — a spurious red
check on every external contribution (e.g. #35). Gate the job to same-repo PRs
(head.repo.full_name == the repo) so fork PRs skip it cleanly instead.

External PRs are still reviewable on demand: the maintainer comments "@claude",
which runs claude.yml on issue_comment in the base-repo context where the secret
is available (and is locked to prashar32).
@prashar32

Copy link
Copy Markdown
Owner

Thanks for this, and welcome! 👋 This is exactly what #30 needed — json tags on LedgerTotals so audit export emits runId/calls/promptTokens/… in line with the rest of the API, plus a test that pins the marshaled shape. Cleanly scoped, it builds, and the tests pass.

One small thing before I merge: per CONTRIBUTING we record user-facing changes in the changelog. There's already a ### Fixed section under ## [Unreleased] in CHANGELOG.md — could you add this bullet to it?

- **`audit export` totals used Go field names**`LedgerTotals` now carries json
  tags, so the `totals` object emits `runId`/`calls`/`promptTokens`/… like the rest
  of the API. ([#30](https://github.com/prashar32/riskkernel/issues/30))

Once that's in I'll squash it in. (You can ignore the red review check — that's my automated reviewer, which can't run on PRs from forks; it isn't a required check.) Thanks again for the contribution!

@prashar32 prashar32 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.

Thanks for this, and welcome! 👋 This is exactly what #30 needed — json tags on LedgerTotals so audit export emits runId/calls/promptTokens/… in line with the rest of the API, plus a test that pins the marshaled shape. Cleanly scoped, it builds, and the tests pass.

One small thing before I merge: per CONTRIBUTING we record user-facing changes in the changelog. There's already a ### Fixed section under ## [Unreleased] in CHANGELOG.md — could you add this bullet to it?

- **`audit export` totals used Go field names**`LedgerTotals` now carries json
  tags, so the `totals` object emits `runId`/`calls`/`promptTokens`/… like the rest
  of the API. ([#30](https://github.com/prashar32/riskkernel/issues/30))

Once that's in I'll squash it in. (You can ignore the red review check — that's my automated reviewer, which can't run on PRs from forks; it isn't a required check.) Thanks again for the contribution!

@prashar32
prashar32 merged commit 416adda into prashar32:main Jun 1, 2026
4 of 5 checks passed
This was referenced Jun 1, 2026
prashar32 added a commit that referenced this pull request Jun 1, 2026
Roll [Unreleased] into [0.1.2] and bump version markers (CLAUDE.md §13):
- CHANGELOG: dated [0.1.2]; add the #30 audit-json-tags entry (credit @yzhkali,
  whose #35 merged without a changelog line); fresh empty [Unreleased]; links.
- docs/VISION.md status → v0.1.2 (released).
- internal/version/version.go default → 0.1.3-dev.
- sdks/python pyproject + __init__ __version__ → 0.1.2.

Contents: #34 (loop/time halt persists status), #30 (audit totals JSON keys),
#47 (MCP audits blocked tools), #48 (memory extensionless lookup).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

audit export: totals object uses Go field names instead of json tags

2 participants