feat(purchasing): raise escalate threshold to €150k + decision audit trail#4
Open
eugnmueller-87 wants to merge 1 commit into
Open
feat(purchasing): raise escalate threshold to €150k + decision audit trail#4eugnmueller-87 wants to merge 1 commit into
eugnmueller-87 wants to merge 1 commit into
Conversation
…trail Two related purchasing-engine changes (one effort): 1. Escalate threshold €50k → €150k. Datacenter hardware runs €30k–€110k a line, so a €50k floor escalated every normal buy to sign-off with NO human-approvable path — the cockpit's "Place approved" had nothing to act on. €150k lets routine buys land in `propose` (a human can approve+place them) while still escalating genuinely exceptional spend. The €25k auto-place cap is unchanged, so large buys still never AUTO-place — they require explicit human approval, just not full escalation. Agent-safety fixtures (A3, A7, over-cap) rescaled above €150k; their invariants (at/above threshold → escalate, never auto-placed) are unchanged. 2. DecisionLog append-only audit trail: every purchasing decision is persisted (best-effort, in a SAVEPOINT so a logging failure never fails the run) with a read-only endpoint over it. Mirrors the AssetEvent spine — immutable rows, one per decision per run, recording actor + tier + rationale. Tests: 310 pass, ruff clean. Migration chains after the onboarding table. Demo-first: ship to demo and verify before any prod promotion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The trigger
On the weekly purchasing screen, 'Place approved' had nothing to act on — every buy was ESCALATED (
0 auto · 0 proposed · 3 escalated), so no checkbox rendered and the button correctly refused. Root cause: a single R760 line is €109k, but the escalate threshold was €50k — so every normal hardware buy escalated to sign-off with no human-approvable path.Change 1 — escalate threshold €50k → €150k
Routine €30k–€110k buys now land in
propose(a human can approve + place them on that screen); only genuinely exceptional €150k+ spend escalates. The €25k auto-place cap is unchanged, so big buys still never auto-place — they require explicit human approval, just not full escalation. Verified: the €109,460 R760 buy now →propose(approvable), not escalate.Agent-safety fixtures (A3 / A7 / over-cap) rescaled above €150k; the invariants they protect (at/above threshold → escalate, never auto-placed) are unchanged.
Change 2 — DecisionLog audit trail (same effort)
Every purchasing decision is now persisted to an append-only DecisionLog (best-effort, inside a SAVEPOINT so a logging failure never fails the run), with a read-only endpoint over it. Mirrors the AssetEvent spine — immutable, one row per decision per run, recording actor + tier + rationale.
Verification
Demo-first
Ships to demo to verify before any prod promotion (
/promote).