feat(research): add campaign family cumulative ledger with replayable receipts - #1102
Open
proerror77 wants to merge 6 commits into
Open
feat(research): add campaign family cumulative ledger with replayable receipts#1102proerror77 wants to merge 6 commits into
proerror77 wants to merge 6 commits into
Conversation
… receipts Record Campaign authorization, attempt reservation, terminal settlement and approval revocation as one authenticated, hash-linked receipt chain per family so cumulative budget admission replays from evidence instead of mutable rows. Unknown consumption after a failed Job keeps the full reservation charged, and revoking a campaign_root approval appends its family receipt in the same transaction as the revocation evidence. Co-authored-by: Cursor <cursoragent@cursor.com>
Unknown consumption stays charged after the store reopens, and a new root under the same family can only reserve the family's remaining trials. Co-authored-by: Cursor <cursoragent@cursor.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| .duration_since(std::time::UNIX_EPOCH) | ||
| .unwrap() | ||
| .as_nanos(); | ||
| let dir = std::env::temp_dir().join(format!( |
| .duration_since(std::time::UNIX_EPOCH) | ||
| .unwrap() | ||
| .as_nanos(); | ||
| let dir = std::env::temp_dir().join(format!( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Adds the Campaign authorization contract and a cumulative, replayable family ledger to the research control plane (
alpha-domain,alpha-store). No live dispatch is wired to it; research code still does not import execution adapters or touch order, risk, or runtime paths.Commits on this branch:
428f7416 feat(research): define signed Campaign root grants—alpha_domain::campaign_control:CampaignRootGrantV1(family policy, execution binding with digest-pinned images, policy allowlist, generation ceiling, root budget, validity window), ed25519 signing/verification into a non-deserializableVerifiedCampaignRootGrant,CampaignAttemptReservationV1with a stableoperation_id, andCampaignAttemptSettlementV1whereconsumed_trials: Nonemeans unknown, never zero.61921633 feat(research): bind grants to declared feedback views— the root grant carriesCampaignEvaluationViewsV1(search/selection view hashes plus feedback visibility). v1 can only declare the shared search/learning-visible walk-forward view, labelledsearch_visible_validation; it cannot claim independent selection.8598c5b7 fix(governance): append approval revocation evidence— migration 004 plusapproval_revocations: revocation is an authenticatedmonday.approval_revocation.v1record bound to the original approval hash; the approval row is never rewritten.get_approvalis the effective view for all authorization consumers, identical replay is idempotent, conflicting or missing evidence after a recorded revocation fails closed.7e938957 feat(research): add campaign family cumulative ledger with replayable receipts— migration 005 pluscampaign_ledger: one authenticated head per family and an append-only, hash-linked chain ofmonday.campaign_ledger_receipt.v1receipts for root registration (signed grant + approval bytes), attempt reservation, terminal settlement, and approval revocation. Reservations charge declared trials / Job seconds / LLM tokens against root and family ceilings before any external operation; a failed Job with unknown consumption keeps the full reservation charged; revoking acampaign_rootapproval appends the family receipt in the same DuckDB transaction as the revocation evidence. Receipts publish to create-once sequence keys and dispatch admission requires an independent readback acknowledgement for every earlier receipt. Family snapshots replay into a fresh store only under the original integrity key; publication acknowledgements are never inferred from a backup. Also promotesed25519-dalekto a regularalpha-storedependency (replay re-verifies the historical grant key), boxes the largeRootRegisteredvariant, and records the revocation receipt atrevoked_atclamped to the chain tail instead of wall-clock time so replay is deterministic and a revocation is never rejected for ordering.7d60e12emerge oforigin/main(26c3da1e, post-fix(research): preserve Campaign checkpoints across interruptions #1100); no Rust conflicts.5d2cd8e4 test(research): prove family budget survives reopen and root change.Issue relationship
None
Validation
From
rust_hft/on head5d2cd8e4:cargo fmt --check --package alpha-store --package alpha-domain— cleancargo test -p alpha-store --locked— 53 passed, 0 failed (8 newcampaign_ledger::tests: chain linkage/ordering, unknown consumption stays charged and blocks over-budget retries, revocation + receipt roll back together when the head cannot be authenticated, scheduled revocation joins at registration and bounds Job deadlines, snapshot import under the original key only, dispatch admission requires readback of every prior receipt, idempotent retransmission / conflicting bytes / family-ceiling escalation rejected, budget survives reopen and root change)cargo test -p alpha-domain --locked— 84 passed, 0 failedcargo clippy -p alpha-store -p alpha-domain --locked --all-targets -- -D warnings— cleancargo check -p alpha-harness --locked --all-targets— clean (dependent app crate)git diff --check— cleanRuntime impact and rollback
None. Research/control-plane only: two additive DuckDB migrations (
004_approval_revocations,005_campaign_family_ledger) create new tables and never rewrite existing rows; no collector, runtime, execution, or risk path changes; no live dispatch consumes the ledger yet. Rollback is reverting the merge; existing approval rows and journal history remain readable.Made with Cursor