Skip to content

Add live receipt integration plan and reference emitter v0.1#8

Merged
mdheller merged 2 commits intomainfrom
feat/live-receipt-integration-v0-1
Apr 5, 2026
Merged

Add live receipt integration plan and reference emitter v0.1#8
mdheller merged 2 commits intomainfrom
feat/live-receipt-integration-v0-1

Conversation

@mdheller
Copy link
Copy Markdown
Member

@mdheller mdheller commented Apr 5, 2026

Summary

This PR seeds the first agentplane-side live receipt integration artifacts:

  • live receipt integration plan v0.1
  • reference live receipt assembler example

Why

Agentplane is the natural receipt owner in the AI+HW+State stack. These artifacts define:

  • the first live GAKW path,
  • repo-by-repo receipt field ownership,
  • event contract expectations,
  • energy accounting boundary,
  • and a strict reference assembler for normalized events -> MAIPJ receipt.

Files added

  • docs/instrumentation/live_receipt_integration_plan.md
  • examples/receipts/agentplane_live_receipt_emitter_reference.py

Review focus

  1. Event names and field ownership.
  2. Whether agentplane should remain the sole receipt owner.
  3. Whether the example emitter path matches the desired execution/event model.

Follow-ons

  • raw event emitters in live codepaths
  • replay manifest binding
  • transport-event ingestion from TriTRPC
  • first live receipt from a real trace

@mdheller mdheller marked this pull request as ready for review April 5, 2026 19:34
@mdheller mdheller merged commit 7087b9c into main Apr 5, 2026
5 checks passed
@mdheller mdheller deleted the feat/live-receipt-integration-v0-1 branch April 5, 2026 19:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83e86274d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +149 to +151
+ float(e["idle"])
+ float(e.get("cooling_adjusted", 0.0))
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include replay energy in energy_j.total

When run.completed includes a non-zero replay_j, this builder stores it in energy_j.replay but does not add it to the total calculation, so emitted receipts under-report total energy and violate the stated invariant that energy components sum to energy_j.total. This affects any replayable runs where replay energy is tracked.

Useful? React with 👍 / 👎.


elif et == "run.completed":
self.receipt.setdefault("energy_j", {}).update({
"train_amortized": p.get("train_amortized", 0.0),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Parse train amortization from the _j event field

All other joule values in run.completed are read from *_j payload keys, but train amortization is read from train_amortized (without _j), so producers emitting train_amortized_j will be silently treated as zero. That creates systematic undercounting and makes the fallback hard to detect because no error is raised.

Useful? React with 👍 / 👎.

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