Repository navigation
Bound first-pilot infrastructure retirement accounting - #1365
Conversation
Reviewer's GuideSchema and migrationsDefine the normative requirements for selecting the bounded pilot graph, accounting for nested calls, preserving single-owner allocations, and keeping runtime qualification separate from source ratification.
Data structuresSpecify the proposed accounting limits, ownership evidence, clocks, and call schedule, together with the machine inventory and canonical fixtures that make the proposal reproducible.
ImplementationDerive and validate the graph, modeled call totals, fixture measurements, and optional hash-guarded baseline parser checks used to reproduce the inventory.
ConfigurationRegister the proposed change in the sequenced-after corpus ledger and record its OpenSpec change metadata.
DocumentationExplain the proposal's motivation, review status, historical eligibility evidence, inventory interpretation, source provenance, and later implementation handoff.
TestsCheck exact inventory reproduction, graph closure and arithmetic, selected caps, fixture and source-hash tampering, and refusal when baseline inputs or roots are invalid.
Preserve the historical eligibility measurements and their machine-readable diagnostic record as evidence rather than treating them as runtime qualification.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 6 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md" line_range="86-87" />
<code_context>
+one authenticated execution-owner incarnation. It uses a single original
+conditional claim with non-reused ETag. Allocation is prepaid and never refunded.
+Registration acknowledgement is forbidden before its durable claim; an ambiguous
+claim/ack is not permission to resend. The provisioner retains its original
+rollback obligation until actual acknowledged external ownership is established.
+
+A live owner keeps exact before-call counters and byte counts for its prepaid
</code_context>
<issue_to_address>
**Handoff permits competing cleanup**
When the claim is durably written, its acknowledgement is lost, and a cleanup trigger reaches the external owner before the provisioner relinquishes rollback responsibility, the provisioner retains rollback responsibility when the durable claim succeeds but its acknowledgement is lost, while the claimed external owner can accept a cleanup trigger. Both actors can then issue destructive operations against the same resources, breaking single-owner/one-send accounting and leaving cleanup outcomes ambiguous.
Make handoff mutually exclusive: durably fence the provisioner before the external owner can act, and require the provisioner to refuse rollback whenever ownership is ambiguous.
</issue_to_address>
### Comment 2
<location path="openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md" line_range="133-134" />
<code_context>
+grants. policy_digest addresses the exact accepted policy; every identity matches
+independently approved source/authority/current storage provenance. not_after is
+clipped to the approved registration/setup scope. No run/link/incarnation of an
+uncreated resource or chosen operational accepted_commit appears in this anchor.
+
+The immutable cleanup claim has exactly `profile`, `anchor_digest`,
+`allocation_ref`, `owner_incarnation_ref`, `trigger_ref`,
</code_context>
<issue_to_address>
**Cleanup claim can change owners**
When the first cleanup claimant has a different incarnation from the registration allocation owner, a cleanup claim can name an `owner_incarnation_ref` different from the anchor’s `registration_owner_incarnation_ref` while still referencing that anchor and allocation. No equality rule prevents a different process from taking the first cleanup claim, transferring mutation authority without owner loss or renewed governance.
Require the cleanup claim’s owner incarnation to equal the authenticated `registration_owner_incarnation_ref` in the immutable anchor.
Also at `openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md:136`.
</issue_to_address>
### Comment 3
<location path="openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/call-inventory.md" line_range="9" />
<code_context>
+
+Three VMs, three OS disks, three NICs, one control public IP, one VNet and three
+role-specific NSGs give 14 ephemeral resources and 16 dependency edges. NSG names
+are nsg-wallet-mfa-{control,gate,worker}-qa-01. Each NSG depends on its own NIC and
+the VNet; VNet depends on all three NICs; control IP on control NIC; each disk/NIC
+on its VM. Three subnets are VNet properties, never separate delete targets.
</code_context>
<issue_to_address>
**Azure retirement order fails**
When the inventory graph is used to order retirement, the graph puts the VNet and NSGs before NICs, omits the NIC-to-VNet dependency, and conflicts with the disposition requiring NSGs to be deleted after the VNet. Azure rejects deletes while resources or associations remain, so the selected retirement plan cannot complete.
Correct the dependency paths and per-kind disposition so they encode one Azure-safe retirement order.
Also at `openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/call-inventory.md:10-11`, `openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/derive-inventory.py:22`.
</issue_to_address>
### Comment 4
<location path="openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md" line_range="98-100" />
<code_context>
+a single advertised call. Required nested work must be exposed to that same
+meter or use a preassigned, disjoint, independently enforced slice of its pool.
+
+A duplicate trigger can inspect only the original claim and cannot claim another
+cleanup pool. Admit at most four trigger deliveries (one owner plus three duplicate
+checks) under this policy; further delivery is refused before work. There are
+at most three observations of each original creation operation and three of each
+original deletion operation, charged to the same cleanup pool. A failed/uncertain
</code_context>
<issue_to_address>
**Concurrent retries consume cleanup allowance**
When duplicate cleanup-trigger deliveries arrive concurrently, concurrent duplicate deliveries can each inspect the same immutable cleanup claim because the policy defines no atomic admission counter or serialized check for the three-duplicate limit. Those checks consume the shared cleanup pool and can exhaust journal allowance before required cleanup work, leaving retirement incomplete.
Serialize duplicate admission through the original owner or add a durable conditional counter that atomically admits at most three duplicate checks before they consume pool calls.
</issue_to_address>
### Comment 5
<location path="openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/derive-inventory.py" line_range="51" />
<code_context>
+"basis":{"adapter":"b39feb3a5e9c30f25b28eb55751beb2ad4ff3e87","factory":"afb20ce1df21199e75550e48732b56ee67069c51","provider_sha256":hashlib.sha256((W/"scripts/workload_factory_binding_runtime/azure_composition/provider.py").read_bytes()).hexdigest(),"namespace_sha256":hashlib.sha256((W/"scripts/workload_factory_binding_runtime/azure_composition/namespace.py").read_bytes()).hexdigest()},
</code_context>
<issue_to_address>
**Inventories claim incorrect source provenance**
When the deriver runs against adapter or factory sources different from the recorded basis, `derive-inventory.py` accepts caller-supplied adapter sources but emits fixed adapter and factory revisions; it also hashes only provider and namespace files, not the imported selection and fixture helpers. The generated inventory can therefore claim provenance from sources that did not generate it, misleading reviewers about the evidence.
Derive the recorded revisions and source hashes from the exact code used, covering all imported helpers that affect the generated inventory.
Also at `openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/derive-inventory.py:9-11`.
</issue_to_address>
### Comment 6
<location path="openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md" line_range="81-83" />
<code_context>
+
+## Durable ownership without a recursive metering journal
+
+Before ownership handoff or a first destructive send, the trusted external
+registration service durably assigns the entire fixed maximum allocation to
+one authenticated execution-owner incarnation. It uses a single original
+conditional claim with non-reused ETag. Allocation is prepaid and never refunded.
+Registration acknowledgement is forbidden before its durable claim; an ambiguous
</code_context>
<issue_to_address>
**Observer cannot use the reserved allocation**
When the execution owner is lost while reconciliation or a late observation is still needed, the registration service assigns the entire prepaid allocation to one execution-owner incarnation, but the separate observer has no authority to spend the observation pool. The unused allocation is stranded, so the promised reconciliation cannot proceed.
Define and durably authorize how the observer can use the observation pool after owner loss without contradicting the single-owner allocation.
Also at `openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md:127-128`.
</issue_to_address>Sourcery assessment
Approval pending. 6 findings to address first.
Blocking findings: openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md:87, openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md:134, openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/call-inventory.md:9, openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/accounting-policy.md:100, openspec/changes/bound-infrastructure-retirement-accounting/supporting-docs/derive-inventory.py:51, and 1 more
|



P07's unchanged provider path exhausts ordinary private12 before completing its second resource, while namespace I/O is unmetered. This source-only amendment selects a dedicated finite infrastructure policy for the first codeXfactory pilot and preserves every existing proof/readback limit.
Paired handoff: opensoft/openXwallet#104
Reviewed pair: factory
89dbe6e6640361c36321968725932058aa802e2bwith walletea7a46206413ba5392734fa67def7dcef6861835.The inventory selects 14 ephemeral resources and 16 dependency edges, including three role-specific NSGs. Registration, cleanup and independently current observation have disjoint pools. Whole maxima are 1088 private / 208 ARM / 768 namespace / 192 journal calls and 16 MiB application bytes; the conservative model is 927 / 168 / 447 / 122. Both facade RPCs and physical backend I/O are charged. Original intervals are 30 / 300 / 60 seconds, each call <=10 seconds, clipped to original approvals/expiry. Old proof Decision/private12/ARM24 and all old routes retain their limits.
The final policy requires a durable exclusive ownership switch before external cleanup, ambiguous-handoff refusal, original registration/cleanup ownership, a separate original observer owner, exact cleanup-claim/anchor binding, serialized admission/debits and read-only resolution of the permanent registration slot. Mutation-owner loss burns its remainder without transfer/restart. The later additive infrastructure account is explicit; ordinary ReadBudget is not enlarged.
Validation:
Exact policy commitment:
sha256:21b62c2621f3d98e5358c1ba4c5b0345a0237d10cfa52e59bea122487688979e.Source-only candidate awaiting owner ratification. T013P07 remains unchecked until later actual complete-graph, real-clock, physical-accounting/privacy/loss controls, full/native/hosted qualification and independent cleanup pass under these fixed limits. Preparation/CI/review does not authorize source acceptance, merge, dependent implementation, setup/dispatch, service/role appointments or live/human/consumer acceptance. Feedback deferred; historical blocked writes unreplayed. GitHub Codex connector review is deferred under the user's explicit local-review instruction.
The actual completed factory checkout is synthetic merge
069c9f88b7221119f421be9a9baac2ac594f0ba6, parents51503c98c4e03e7f17b390aa8886a6757d3a681d(main) and reviewed head89dbe6e6640361c36321968725932058aa802e2b. Its tree differs from the reviewed candidate only by the four independently assessed upstream #1364 paths; full suite and Sonar both tested that integration. Artifact source hashes match the reviewed files plus exactly the upstream pin-reader file; all three coverage configs match. This replaces the earlier provisional freshness concern. Recheck refs/checks at any later authorized landing.