Skip to content

Broaden the Critic to every detector; share the seam via ephor core (ADR-0023) - #76

Merged
Nabzx merged 1 commit into
mainfrom
feat/critic-everywhere-75
Sep 5, 2026
Merged

Nabzx merged 1 commit into
mainfrom
feat/critic-everywhere-75

Conversation

@Nabzx

@Nabzx Nabzx commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Closes #75.

What

Critique, the Critic Protocol, and FakeCritic move out of cloud_waste/critic.py into ephor.critic - a shared core primitive needing nothing beyond stdlib/dataclasses, zero new dependencies for ephor. ClaudeCritic/ClaudeCriticSettings (the real, paid implementation) stay in cloud_waste/critic.py, importing Critique/Critic from ephor.critic - keeps anthropic out of ephor's own dependency list entirely.

stripe_recovery.detector.scan_for_recoverable_charges and wallet_guard.detector.scan_for_risky_approvals both gain the same optional critic: Critic | None = None param cloud-waste's two scans already have, attaching critique.as_snapshot_field() to the Snapshot before it's hashed when one is passed. Zero behaviour change for any existing caller. Both demos now wire in FakeCritic() and print the critique line, same as cloud-waste's demo already does - no real ClaudeCritic option is wired into either, that stays cloud-waste-only.

Why extend the seam, given ADR-0021 scoped the Critic to cloud-waste specifically

ADR-0021 reasoned the Critic belongs on cloud-waste because idle-instance detection is a genuine judgement call, unlike stripe-recovery/wallet-guard's already-unambiguous allow-list checks. That argued the Critic wasn't necessary elsewhere - not that it would be harmful. An advisory-only critique (never a veto, per ADR-0021 point 3) costs nothing safety-wise even on an already-unambiguous rule, and can still flag an evidence-level anomaly the fixed rule was never written to look at. Written up as ADR-0023.

Verification

All four packages verified independently:

  • ephor: ruff check / ruff format --check / mypy . clean, pytest -v green (new ephor/tests/test_critic.py).
  • cloud-waste: same, 51 tests passing (down from 54 - three FakeCritic/Critique tests moved to ephor, not lost).
  • stripe-recovery: same, 32 tests passing.
  • wallet-guard: same, 25 tests passing.
  • All three demos (uv run python -m <pkg>.demo) run end to end with the critic line printing correctly.
  • Diff scoped to ephor/, cloud-waste/, stripe-recovery/, wallet-guard/, and docs/adr/ - no backend//frontend/ changes.

…ADR-0023)

Critique, the Critic Protocol, and FakeCritic move out of cloud_waste/critic.py
into ephor.critic - a shared core primitive needing nothing beyond stdlib/
dataclasses. ClaudeCritic (the real, paid implementation) stays in cloud-waste
deliberately, so ephor itself never gains anthropic as a dependency.

stripe_recovery.detector.scan_for_recoverable_charges and
wallet_guard.detector.scan_for_risky_approvals both gain the same optional
critic: Critic | None = None param cloud-waste's scans already had, attaching
a critique to the Snapshot before it's hashed when one is passed. Zero
behaviour change for any existing caller. Both demos now wire in FakeCritic()
and print the critique line, same as cloud-waste's demo already does.

ADR-0021 scoped the Critic to cloud-waste specifically, since idle-instance
detection was the actual judgement call it solved - that reasoning argued the
Critic wasn't necessary elsewhere, not that it would be harmful. An advisory-
only critique (never a veto, either way) costs nothing safety-wise even on an
already-unambiguous rule, and can still flag an evidence-level anomaly the
fixed rule never looks at. Written up as ADR-0023, filed and closes #75.

All four packages verified independently: ruff/mypy clean, full pytest green
(ephor, cloud-waste 51 tests, stripe-recovery 32, wallet-guard 25), all three
demos run end to end with the critic line printing correctly.

Closes #75
@Nabzx
Nabzx merged commit af9c823 into main Sep 5, 2026
7 checks passed
@Nabzx
Nabzx deleted the feat/critic-everywhere-75 branch September 5, 2026 00:41
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.

Extend the Critic to stripe-recovery and wallet-guard, share the seam via ephor core

1 participant