Skip to content

feat(purchasing): raise escalate threshold to €150k + decision audit trail#4

Open
eugnmueller-87 wants to merge 1 commit into
mainfrom
feat/purchasing-threshold-and-decision-audit
Open

feat(purchasing): raise escalate threshold to €150k + decision audit trail#4
eugnmueller-87 wants to merge 1 commit into
mainfrom
feat/purchasing-threshold-and-decision-audit

Conversation

@eugnmueller-87

Copy link
Copy Markdown
Owner

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

  • 310 tests pass, ruff clean.
  • Migration chains cleanly after the onboarding table.

Demo-first

Ships to demo to verify before any prod promotion (/promote).

…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>
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