Logo di Transactional Integrity

Transactional Integrity

Community
Dark-Alex-17
transactional-integrity

Esamina il codice che modifica lo stato per verificarne l’integrità transazionale: lacune nell’atomicità, race condition di tipo read-modify-write, handler non idempotenti per input con consegna almeno una volta, scritture doppie su un DB e un sistema esterno, effetti collaterali che sfuggono al rollback o si ripetono in caso di nuovo tentativo e ipotesi sul livello di isolamento. Indipendente dal tipo di archivio (transazioni SQL, scritture condizionali DynamoDB, Redis MULTI, archivi di documenti). Carica questa skill quando una modifica riguarda scritture su DB, transazioni, handler di code/webhook/job o effetti collaterali esterni. Le segnalazioni seguono la tassonomia standard di gravità delle code review. Consente l’accesso in sola lettura al file system per tracciare i confini delle transazioni.

Panoramica

Pubblicato daDark-Alex-17
Repositorycoyote
Nome della skilltransactional-integrity
Stelle
56
Fork
2
File inclusi
Solo istruzioni
LicenzaAGPL-3.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da Dark-Alex-17 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Transactional Integrity in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/Dark-Alex-17/coyote/tree/main/assets/skills/transactional-integrity
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Dark-Alex-17/coyote.git /tmp/coyote
mkdir -p .claude/skills
cp -r /tmp/coyote/assets/skills/transactional-integrity .claude/skills/transactional-integrity
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Transactional Integrity in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Transactional Integrity non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Transactional Integrity non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

You are reviewing state-changing code. The generic correctness checklist asks "does this work?"; you ask the three questions that page people at 3am: "what happens when this runs twice? halfway? concurrently?" Most production data-corruption incidents are not wrong business logic — they are correct logic executed under a failure mode the author never considered: a retry, a crash between two writes, or a second copy of the process.

When to load this skill

The diff touches ANY of: database writes, transaction blocks, queue/stream consumers, webhook handlers, scheduled/background jobs, retry logic, or calls to external state-holding systems (payment providers, email, other services). If the diff is pure reads, UI, or stateless computation — unload; this checklist has nothing for you.

The checklist

1. Atomicity: do multi-step writes share a transaction?

Find every place the diff performs two or more writes that must succeed or fail together (insert parent + child, update balance + write ledger entry, state transition + audit row). Then verify they actually share an atomic unit:

  • SQL: same transaction — and confirm it by READING the enclosing scope, not by assuming; a helper called from two places may run with and without a wrapping transaction.
  • DynamoDB: TransactWriteItems or a single-item design, not two PutItem calls.
  • Redis: MULTI/EXEC or a Lua script, not sequential commands.
  • Document stores: single-document update or multi-document transaction, not two updates.

A crash between unguarded writes is a FINDING: name the two writes, the window, and the resulting inconsistent state.

2. Read-modify-write: what happens when two run concurrently?

Every read → decide → write sequence is a lost-update race unless something serializes it:

  • SELECT then UPDATE with no FOR UPDATE, no optimistic version/etag check, no atomic UPDATE ... SET x = x + 1, no conditional write (ConditionExpression, compare-and-set).
  • Check-then-insert uniqueness ("does username exist?" then insert) with no DB unique constraint backing it — application-level checks NEVER close the race; the constraint is the fix, the check is UX.
  • In-memory caches of DB state mutated alongside the DB without invalidation ordering.

Ask: is there exactly one writer, structurally guaranteed (singleton job, partition ownership)? If yes, note the assumption and move on — flagging single-writer code for races is noise. If concurrency is possible, the missing guard is a finding.

3. Idempotency: is every at-least-once input handled at-most-once?

Queue consumers, webhook handlers, scheduled jobs, and anything retried WILL run more than once with the same input. For each handler the diff adds or modifies:

  • Is there an idempotency key, dedupe table, INSERT ... ON CONFLICT DO NOTHING, or conditional state transition (WHERE status = 'pending') that makes the second delivery a no-op?
  • Does the handler complete its side effects BEFORE acknowledging/deleting the message? Ack-then-process loses work; process-then-ack requires idempotency.
  • Partial failure: if the handler does A, B, C and crashes after B, the redelivery re-runs A and B — are they safe to re-run?

An error path that neither succeeds nor removes the message (so it redelivers forever into a DLQ) is also a finding — poison-message handling is part of idempotency.

4. Dual-write: DB + external system with no reconciliation

The diff writes to the local DB AND to an external state holder (payment provider, email service, another service's API, a search index) in one flow. One succeeds, the other fails — now the two systems disagree:

  • Look for the outbox pattern (write intent to DB in the transaction, deliver asynchronously), a saga/compensation step, or at minimum an explicit reconciliation job.
  • "Call external API inside the DB transaction" is not a fix — it holds locks across network I/O and still diverges when the commit itself fails after the call succeeded.
  • Order matters: charging a card before durably recording the intent to charge means a crash produces a charged-but-unprovisioned customer; the reverse produces a recorded-but-unfulfilled intent, which is recoverable.

Flag the divergence window and which side wins on replay.

5. Side effects vs rollback and retry

  • Anything non-transactional fired INSIDE a transaction (email sent, event published, cache invalidated) happens even when the transaction rolls back. It must move after commit (or into an outbox).
  • Anything fired inside a RETRIED scope (job framework with automatic retries, HTTP client with retry middleware) re-fires per attempt unless guarded.
  • Metrics/logs are exempt — do not flag observability as a side-effect violation.

6. Isolation assumptions

Code that is only correct under SERIALIZABLE but runs at the store's default (READ COMMITTED in Postgres, REPEATABLE READ in MySQL) is a latent race. Watch for: aggregate checks before writes ("sum of debits ≤ balance"), multi-row invariants enforced in application code, and phantom-sensitive queries. If the diff's correctness depends on an isolation level, verify the code SETS it rather than assumes it.

Ground-truth discipline

  • READ the enclosing scope of every write the diff touches — transaction boundaries live up-stack from the hunk. fs_grep the function's callers to learn whether it already runs inside a transaction.
  • fs_grep the handler registration/config for retry counts, DLQ wiring, and delivery semantics before claiming "this retries."
  • Check sibling handlers for the idempotency pattern the codebase already uses (dedupe table, conditional transition) — a new handler skipping the established guard is the strongest form of evidence.
  • Do not flag theoretical races in structurally single-writer code; note the single-writer assumption instead so the next reviewer sees it was considered.

Finding format and severity

Fold findings into the standard review severities — no separate verdict:

  • 🔴 CRITICAL — money/data loss or corruption under a realistic failure (dual-write with no reconciliation on a paid flow; lost-update race on a balance; non-idempotent charge handler).
  • 🟡 WARNING — inconsistency window or unbounded redelivery with operational (not monetary) blast radius; missing constraint behind a check-then-act.
  • 🟢 SUGGESTION — hardening: add the missing unique constraint even though the race is improbable, move the email after commit.

Every finding names: the writes involved (file:line), the failure mode that triggers it (crash between X and Y / concurrent execution / redelivery), and the concrete fix. "This might have race conditions" is noise; "second invoice.paid delivery re-runs the provisioning insert at handler.go:88 because there is no dedupe on event_id — add the unique index the payment handler at handler.go:41 already uses" is signal.

Anti-patterns

  • Flagging every read-then-write as a race without checking who else writes.
  • Demanding SERIALIZABLE everywhere — the finding is an UNSTATED isolation assumption, not a low isolation level.
  • Treating logs/metrics as dual-writes.
  • Reviewing the hunk without reading the enclosing transaction scope — most false positives and false negatives in this domain come from not knowing whether you're already inside a transaction.
  • Accepting "the framework handles it" without grepping the framework config that proves it.

Domande frequenti

Cosa fa la skill IA Transactional Integrity?

Esamina il codice che modifica lo stato per verificarne l’integrità transazionale: lacune nell’atomicità, race condition di tipo read-modify-write, handler non idempotenti per input con consegna almeno una volta, scritture doppie su un DB e un sistema esterno, effetti collaterali che sfuggono al rollback o si ripetono in caso di nuovo tentativo e ipotesi sul livello di isolamento. Indipendente dal tipo di archivio (transazioni SQL, scritture condizionali DynamoDB, Redis MULTI, archivi di documenti). Carica questa skill quando una modifica riguarda scritture su DB, transazioni, handler di co...

Perché usare Transactional Integrity su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Transactional Integrity è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Transactional Integrity in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/Dark-Alex-17/coyote/tree/main/assets/skills/transactional-integrity. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Transactional Integrity?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Transactional Integrity?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Transactional Integrity: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Transactional Integrity è gratuita?

Sì. È pubblicata su GitHub da Dark-Alex-17 con licenza AGPL-3.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇