About fable-anti-churn
fable-anti-churn is a get-fable skill that prevents duplicate work and reuses verified evidence by fingerprinting actions and tracking receipts. It is intended for agents maintaining test, build, and analysis workflows, with lifecycle hooks that block repeated actions and blind retries.
Key features
- 01Cryptographic fingerprints for actions
- 02Reuse of matching passing evidence
- 03Blocking duplicate or pending actions
- 04Fencing retries after deterministic failures
- 05Lifecycle-hook reservation checks
Use cases
- 01Checking before repeated tests or builds
- 02Preventing duplicate subagent or external-tool calls
- 03Requiring local fixes after deterministic failures
- 04Validating candidate promotion gates
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ immamdouhaboammar/ get-fable --skill fable-anti-churnAfter installing, type/fable-anti-churnin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
README.mdskill.package.jsonagents/openai.yamlassets/Agent Churn Control Vector Dark 230826.svgAgent Churn Control Vector Master 230826.svgauthority-map.jsoncontract.schema.jsoncore-policy.jsonLogo Generation Manifest 230826.jsonpackage-manifest.jsonsample-efficiency-measurement.jsonsample-event.jsonsample-receipt.jsonevals/agent-churn-control-activation-golden.jsonscenarios.jsonfixtures/v1/corpus.ndjsonreferences/CLAUDE-INSTALL.mdCODEX-INSTALL.mdDECISIONS-AND-RECEIPTS.mddoctrine_review.mdEVALUATION.mdOPENAI-PLUGIN-SUBMISSION.mdPRIVACY.mdTHREAT-MODEL.mdscripts/churn_control.pytemplates/EVENT_TEMPLATE.jsonRECEIPT_TEMPLATE.jsontests/test_churn_control.pytools/build_package_manifest.pyrender_store_assets.pyDetails
From the project READMEFable Anti-Churn
Purpose
fable-anti-churn is the authoritative duplicate-work and evidence-reuse prevention engine in get-fable. Powered by both a native Rust engine (crates/fable-anti-churn) and local CLI scripts, it cryptographically fingerprints work requests (RFC 8785 JCS + SHA-256), tracks reservation receipts, reuses identical prior passing evidence, blocks duplicate actions, halts repeated deterministic failures, and validates promotion proof with sub-millisecond execution.
When to Use
- Before dispatching repetitive test commands, build scripts, or static analysis tools.
- Before spawning subagents, background workflows, or external tool calls.
- When an action or command fails deterministically, requiring local repair rather than blind retries.
- When evaluating candidate promotion gates (package integrity, test passing, authority verification).
- Across all lifecycle hooks (
SessionStart,PreToolUse,PostToolUse,PostToolUseFailure,Stop).
When NOT to Use
- NOT to cancel or terminate the entire user task — gates only the specific duplicate local action.
- NOT as a substitute for valid code changes; once code changes, compute a typed invalidation (
candidate_changed, etc.) to run anew. - NOT to bypass real human authorization or security boundaries.
Inputs
action_event: Canonical JSON payload containingaction_kind,action_scope_digest,requirements_digest,candidate_digest, and environmental hashes.prior_receipts: Historical receipts ledger in NDJSON format (.fable/anti-churn/receipts.ndjson).core_policy: Policy configuration containing intervention level thresholds and retry budget parameters.
Expected Outputs
decision_receipt: Cryptographically signed receipt with 35 canonical fields,decision,reason_code, andevidence_digest.evidence_acceptance: Stamped evidence acceptance record updating a pending reservation with verified outcome.churn_status: Real-time ledger status reporting total receipts, pending reservations, passing evidence, and blocked churn cycles.
Procedure
- Fingerprint Work Identity: Hash scope, requirements, candidate patch, dependencies, policy, and evaluator using RFC 8785 canonical JSON and SHA-256.
- Consult Prior Ledger: Scan
.fable/anti-churn/receipts.ndjsonfor existing matching reservations or passing evidence. - Evaluate Idempotency:
- If exact passing evidence exists without invalidation: emit
reuse_prior_evidence. - If pending in-flight reservation exists: emit
block_this_local_action(prevent race condition). - If deterministic local failure exists without workspace mutation: emit
local_fix_required. - If work changed with valid typed invalidation: emit
allow_reexecution. - If first equivalent action: emit
allowand record reservation receipt.
- If exact passing evidence exists without invalidation: emit
- Execute & Record Outcome:
- On success: run
acceptto transition reservation topass. - On local failure: record
local_failurereceipt to fence immediate duplicate execution.
- On success: run
- Enforce Hook Invariants: Intercept lifecycle events to ensure zero unaccepted reservations or churn loops remain at turn completion.
Decision Rules
- ALLOW: First equivalent action without prior reservation; reserves slot with pending receipt.
- ALLOW_REEXECUTION: Allowed re-run after consuming a valid, unconsumed typed invalidation.
- ALLOW_WITH_ADVISORY: Allowed when work identity is incomplete (rate advisory emitted).
- REUSE_PRIOR_EVIDENCE: Exact matching work has prior passing evidence; returns stored
evidence_digestwith zero token overhead. - LOCAL_FIX_REQUIRED: Deterministic local failure detected; blocks execution until code is edited.
- BLOCK_THIS_LOCAL_ACTION: Duplicate pending action, invalid fanout, or changed work without typed invalidation.
Tool Policy
- Read-only queries preferred for check and verification steps.
- Native Rust engine binary (
fable-anti-churnorget-fable-native anti-churn) used for sub-millisecond execution. - Direct NDJSON state file updates guarded by atomic filesystem locking (
fs2). - Never delete or corrupt historical receipts; maintain immutable append-only ledger.
Evidence Requirements
- Validated receipts containing all 35 canonical fields and 0 prohibited keys.
- SHA-256 digests adhering to
sha256:[0-9a-f]{64}format. - Passing self-test corpus report confirming 23/23 scenario verifications.
- Verified absence of pending reservations before marking lifecycle phases complete.
Failure Handling
- If
local_fix_requiredordeterministic_local_failureis encountered: edit target source code to resolve the defect. Workspace mutation clears the failure lock. - If invalidation is rejected: inspect invalidation target receipt and ensure reason code matches the changed field.
- If failure streak reaches 2: route to
fable-recoverto diagnose root cause before attempting code edits.
Completion Criteria
- All open reservations transitioned to
passor explicit terminal outcome. - Zero unresolved pending reservations in
.fable/anti-churn/receipts.ndjson. - State ledger passes
anti-churn verifywith 0 validation errors. - Passing tests verified with fresh evidence matching current mutation generation.
CLI Commands
# Evaluate an action event against receipts ledger
bun ./bin/get-fable.js anti-churn decide event.json
# Accept passing evidence for an open reservation
bun ./bin/get-fable.js anti-churn accept <receipt-id> <evidence-digest> [pass|local_failure]
# Quick zero-latency check if an action/command is duplicate
bun ./bin/get-fable.js anti-churn check --action-kind targeted_test --target src/core.ts --command "bun test"
# Verify receipts ledger integrity
bun ./bin/get-fable.js anti-churn verify
# Run native 23-fixture self-test corpus
bun ./bin/get-fable.js anti-churn self-test
# Check anti-churn status & metrics
bun ./bin/get-fable.js anti-churn status
Lifecycle Hook Enforcement
- SessionStart: Scan
.fable/anti-churn/receipts.ndjsonfor open reservations or persistent local failure loops. - PreToolUse (Bash / Agent): Compute action key. If duplicate without invalidation, intercept and block.
- PostToolUse (Write / Edit): Compute new candidate hash and clear local failure locks.
- PostToolUse (Bash Success): Invalidate failure tracking.
- PostToolUseFailure (Bash Failure): Detect deterministic local failure loops and block blind retries.
- Stop: Verify no unsettled reservations or corrupted receipts before closing turn.
Progressive Resources
- Decisions & Receipts Architecture — Comprehensive receipt schema and 35 canonical fields specification.
- Threat Model — Security boundaries, trust domains, and tampering prevention.
- Privacy Policy — Prohibited fields and secret redaction enforcement.
- Evaluation Protocol — 23-scenario verification matrix and baseline assertions.
- Doctrine Review — Mathematical and architectural foundations of duplicate work prevention.
- Claude Integration — Host lifecycle hook setup for Claude Code.
- Codex Integration — Host lifecycle hook setup for OpenAI Codex.
- Event Template — Standard action event JSON template.
- Receipt Template — Canonical decision receipt JSON template.