From ea9e854a847ec5cd3f6eef0dc73760059c49a673 Mon Sep 17 00:00:00 2001 From: DavidHLP Date: Sun, 11 Oct 2026 06:42:00 -0700 Subject: [PATCH 1/3] test: retain sealed confirmation acceptance costs --- .../tests/test_v16_confirmation_history.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 services/agent/tests/test_v16_confirmation_history.py diff --git a/services/agent/tests/test_v16_confirmation_history.py b/services/agent/tests/test_v16_confirmation_history.py new file mode 100644 index 000000000..1e2e66424 --- /dev/null +++ b/services/agent/tests/test_v16_confirmation_history.py @@ -0,0 +1,18 @@ +from authorized_budget_period import policy_for + + +def test_confirmation_revalidation_retains_settled_v15_and_unknown_liabilities(): + old = policy_for("acceptance-revalidation-v15") + policy = policy_for("acceptance-revalidation-v16") + history = policy["history"] + assert history["attempts"] == old["history"]["attempts"] + 103 == 1286 + assert history["known_actual_micro_usd"] == old["history"]["known_actual_micro_usd"] + 35648 == 365717 + assert history["known_committed_micro_usd"] == old["history"]["known_committed_micro_usd"] + 922800 == 11363714 + assert history["unknown_attempts"] == old["history"]["unknown_attempts"] == 3 + assert history["unknown_encumbrance_micro_usd"] == old["history"]["unknown_encumbrance_micro_usd"] == 2359296 + assert history["cumulative_limit_micro_usd"] == old["history"]["cumulative_limit_micro_usd"] == 200000000 + assert history["cumulative_attempt_limit"] == history["attempts"] + policy["attempts"] == 1527 + assert policy["lanes"] == old["lanes"] + assert policy["limit_micro_usd"] == old["limit_micro_usd"] + assert (history["known_committed_micro_usd"] + history["unknown_encumbrance_micro_usd"] + + policy["limit_micro_usd"] <= history["cumulative_limit_micro_usd"]) From 98ae4f7cd288110dea43bee1a0425fecbc2d90e3 Mon Sep 17 00:00:00 2001 From: DavidHLP Date: Sun, 11 Oct 2026 06:43:04 -0700 Subject: [PATCH 2/3] fix: retain sealed V15 liabilities for confirmation revalidation --- .../agent/src/authorized_budget_period.py | 14 ++++++++++ services/agent/src/revalidation_history.py | 27 ++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/services/agent/src/authorized_budget_period.py b/services/agent/src/authorized_budget_period.py index 63074d154..ff402fe4d 100644 --- a/services/agent/src/authorized_budget_period.py +++ b/services/agent/src/authorized_budget_period.py @@ -75,6 +75,7 @@ REVALIDATION_V13_POLICY_ID = "acceptance-revalidation-v13" REVALIDATION_V14_POLICY_ID = "acceptance-revalidation-v14" REVALIDATION_V15_POLICY_ID = "acceptance-revalidation-v15" +REVALIDATION_V16_POLICY_ID = "acceptance-revalidation-v16" REVALIDATION_POLICY_IDS = frozenset({REVALIDATION_POLICY_ID, REVALIDATION_V2_POLICY_ID, REVALIDATION_V3_POLICY_ID, REVALIDATION_V4_POLICY_ID, REVALIDATION_V5_POLICY_ID, REVALIDATION_V6_POLICY_ID, REVALIDATION_V7_POLICY_ID, REVALIDATION_V8_POLICY_ID, REVALIDATION_V9_POLICY_ID, REVALIDATION_V10_POLICY_ID, REVALIDATION_V11_POLICY_ID, REVALIDATION_V12_POLICY_ID}) REVALIDATION_V2_HISTORY = MappingProxyType({ "attempts": 164, "known_actual_micro_usd": 42_307, @@ -239,6 +240,17 @@ }) REVALIDATION_POLICY_IDS = REVALIDATION_POLICY_IDS | {REVALIDATION_V15_POLICY_ID} +REVALIDATION_V16_HISTORY = MappingProxyType({ + "attempts": 1286, "known_actual_micro_usd": 365_717, + "known_committed_micro_usd": 11_363_714, + "unknown_attempts": 3, "unknown_encumbrance_micro_usd": 2_359_296, + "cumulative_attempt_limit": 1527, "cumulative_limit_micro_usd": 200_000_000, +}) +REVALIDATION_V16_POLICY = MappingProxyType({ + **REVALIDATION_V15_POLICY, "history": REVALIDATION_V16_HISTORY, +}) +REVALIDATION_POLICY_IDS = REVALIDATION_POLICY_IDS | {REVALIDATION_V16_POLICY_ID} + def policy_for(policy_id: str): if policy_id == POLICY_ID: @@ -273,6 +285,8 @@ def policy_for(policy_id: str): return REVALIDATION_V14_POLICY if policy_id == REVALIDATION_V15_POLICY_ID: return REVALIDATION_V15_POLICY + if policy_id == REVALIDATION_V16_POLICY_ID: + return REVALIDATION_V16_POLICY raise PeriodError("unsupported policy") diff --git a/services/agent/src/revalidation_history.py b/services/agent/src/revalidation_history.py index 932ea8064..f4f117c5d 100644 --- a/services/agent/src/revalidation_history.py +++ b/services/agent/src/revalidation_history.py @@ -281,13 +281,30 @@ def _check_unknown_rollover(snapshot, guard, *, predecessor="v2"): } +V15_ROLLOVER_IDENTITY = { + "period_id": "revalidation-v15-20261011", + "identity": "8b7f3fc4d4554bd99feb43cd3ae889af", + "config_sha256": "f83b200a2aed0085090377bd60427b252d7e2c0423a810bde63d6c49103f84d3", + "policy_id": "acceptance-revalidation-v15", +} +V15_ROLLOVER_SHA256 = { + "budget.sqlite3": "c29d0368239c4caeaadc74c0a719933c3a367ff10cff0da311bc6e9048567560", + "binding.json": "726effe429045a098633ca9ccf812ff84bfef2181ea54f9476a08c323f2d8651", + "dav58-increment-8b7f3fc4d4554bd99feb43cd3ae889af.json": "85238b3fc50363a9d9fa19db96fa16c0f4670aa73473d2ace81972c447a03e2f", +} + + def _validate_rollover_history(sources, *, settled_policy="v1"): - from authorized_budget_period import REVALIDATION_V14_HISTORY, REVALIDATION_V15_HISTORY + from authorized_budget_period import REVALIDATION_V14_HISTORY, REVALIDATION_V15_HISTORY, REVALIDATION_V16_HISTORY from authorized_budget_period import PeriodError, PeriodIdentity, REVALIDATION_V2_HISTORY, REVALIDATION_V4_HISTORY, REVALIDATION_V5_HISTORY, REVALIDATION_V6_HISTORY, REVALIDATION_V7_HISTORY, REVALIDATION_V8_HISTORY, REVALIDATION_V9_HISTORY, REVALIDATION_V10_HISTORY, REVALIDATION_V11_HISTORY, REVALIDATION_V12_HISTORY, _parent, _file from model_budget import ModelBudget, authorization_slot from dav58_live_guard import IncrementalGuard - if settled_policy == "v14": + if settled_policy == "v15": + original = _validate_rollover_history(sources, settled_policy="v14") + identity, fingerprints = V15_ROLLOVER_IDENTITY, V15_ROLLOVER_SHA256 + totals, history = (103, 35_648, 922_800), REVALIDATION_V16_HISTORY + elif settled_policy == "v14": original = _validate_rollover_history(sources, settled_policy="v13") identity, fingerprints = V14_ROLLOVER_IDENTITY, V14_ROLLOVER_SHA256 totals, history = (97, 33_416, 872_400), REVALIDATION_V15_HISTORY @@ -367,7 +384,7 @@ def _validate_rollover_history(sources, *, settled_policy="v1"): try: # Validate sealed receipts without making the permanently halted journal resumable. receipt_view = guard - if settled_policy in {"v13", "v14"}: + if settled_policy in {"v13", "v14", "v15"}: if guard.get("halted") is not True: raise PeriodError("previous guard must be permanently halted") receipt_view = {**guard, "halted": False} @@ -380,10 +397,12 @@ def _validate_rollover_history(sources, *, settled_policy="v1"): def validate_history(sources, *, policy_id="acceptance-revalidation-v1"): - from authorized_budget_period import REVALIDATION_V13_POLICY_ID, REVALIDATION_V14_POLICY_ID, REVALIDATION_V15_POLICY_ID + from authorized_budget_period import REVALIDATION_V13_POLICY_ID, REVALIDATION_V14_POLICY_ID, REVALIDATION_V15_POLICY_ID, REVALIDATION_V16_POLICY_ID from authorized_budget_period import PeriodError, REVALIDATION_HISTORY, _parent, _file from authorized_budget_period import REVALIDATION_POLICY_ID, REVALIDATION_V2_POLICY_ID, REVALIDATION_V3_POLICY_ID, REVALIDATION_V4_POLICY_ID, REVALIDATION_V5_POLICY_ID, REVALIDATION_V6_POLICY_ID, REVALIDATION_V7_POLICY_ID, REVALIDATION_V8_POLICY_ID, REVALIDATION_V9_POLICY_ID, REVALIDATION_V10_POLICY_ID, REVALIDATION_V11_POLICY_ID, REVALIDATION_V12_POLICY_ID + if policy_id == REVALIDATION_V16_POLICY_ID: + return _validate_rollover_history(sources, settled_policy="v15") if policy_id == REVALIDATION_V14_POLICY_ID: return _validate_rollover_history(sources, settled_policy="v13") if policy_id == REVALIDATION_V15_POLICY_ID: From f14cc4e4ae0ebc38e935440a98c5c4f9e10e7a26 Mon Sep 17 00:00:00 2001 From: DavidHLP Date: Sun, 11 Oct 2026 06:44:17 -0700 Subject: [PATCH 3/3] docs: bind confirmation revalidation to preserved history --- docs/DEVELOPMENT.md | 7 +++++++ services/agent/data/repository_corpus_manifest.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index f39eb69cc..a8bb42650 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -497,6 +497,7 @@ The same explicitly authorized rollover contract applies to the later supported | `acceptance-revalidation-v13` | V12, including its retained unknown request | | `acceptance-revalidation-v14` | Settled V13 on the integrated U03 candidate | | `acceptance-revalidation-v15` | Settled V14, including its invalid-JSON failure | +| `acceptance-revalidation-v16` | Settled V15, including the stale-confirmation U03 failure | Before preparation, retain the predecessor ledger, binding and guard at their pinned fingerprints and preserve the entire earlier history chain. The selected policy's @@ -535,6 +536,12 @@ failure and all known costs in V14; do not resume it or reinterpret it as passin acceptance. The earlier three unknown liabilities and every purpose/token cap remain unchanged. A new complete prefix must establish acceptance for the changed adapter. +V16 retains the permanently halted V15 ledger, binding and guard for confirmation +invalidation revalidation. Keep the original incomplete U03 result and its settled +costs; the earlier U02 gate remains evidence for its original candidate only. The +same cumulative USD200 ceiling, three unknown liabilities and purpose/token caps +apply. Fresh acceptance must bind the changed service rather than relabel old proof. + Issue the evidence-bound U02 gate only after those inputs validate. Gate artifact references are relative to the private directory containing the gate; place the referenced artifacts there: diff --git a/services/agent/data/repository_corpus_manifest.json b/services/agent/data/repository_corpus_manifest.json index 64b71a166..43f824847 100644 --- a/services/agent/data/repository_corpus_manifest.json +++ b/services/agent/data/repository_corpus_manifest.json @@ -29,8 +29,8 @@ }, { "doc_id": "repository-development", - "version": "sha256-8fd11b59eea6f0663bf45ad4261f6ab2e183b2098b3308c18dc05891c64a2b58", - "chunk_id": "repository-development:sha256-8fd11b59eea6f0663bf45ad4261f6ab2e183b2098b3308c18dc05891c64a2b58:1", + "version": "sha256-df792c4eeb93390edb6fccb5896153f620d8dfd9b7dd1735080baeaf7edc5a32", + "chunk_id": "repository-development:sha256-df792c4eeb93390edb6fccb5896153f620d8dfd9b7dd1735080baeaf7edc5a32:1", "source_path": "docs/DEVELOPMENT.md", "access_scope": "repository-public", "sample_kind": "real",