[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71NGNWHBMBAPZMTMGC4AWTZ":3,"skill-same:01M71NGNWHBMBAPZMTMGC4AWTZ":106},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M71NGNWHBMBAPZMTMGC4AWTZ","ln-652-transaction-correctness-auditor",null,"Checks transaction scope, missing rollback handling, long-held transactions, trigger\u002Fnotify interaction. Use when auditing transaction correctness.","vitalikpestov\u002FSkills-Catalog","vitalikpestov","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F13882997?v=4","01M71N4QG0CWRXX4R24JQZXDDQ","Vitalik Pestov","01M71N4QGMSYRW607DDSE0CQMM",2,"MIT","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"correctness","transaction","ln 652 transaction correctness auditor","auditor","ln","trigger","graph","paths","read","line","interaction","transactions","references","Bash","when","MCP","hex","notify","search","scope","2026-11-10 10:56:23",false,"---\nname: ln-652-transaction-correctness-auditor\ndescription: \"Checks transaction scope, missing rollback handling, long-held transactions, trigger\u002Fnotify interaction. Use when auditing transaction correctness.\"\nallowed-tools: Read, Grep, Glob, Bash, mcp__hex-graph__find_references, mcp__hex-graph__trace_paths, mcp__hex-line__read_file, mcp__hex-line__grep_search, mcp__hex-line__outline\nlicense: MIT\n---\n\n> **Paths:** File paths (`references\u002F`, `..\u002Fln-*`) are relative to this skill directory.\n\n# Transaction Correctness Auditor (L3 Worker)\n\n**Type:** L3 Worker\n\nSpecialized worker auditing database transaction patterns for correctness, scope, and trigger interaction.\n\n## Purpose & Scope\n\n- Audit **transaction correctness** (Priority: HIGH)\n- Check commit patterns, transaction boundaries, rollback handling, trigger\u002Fnotify semantics\n- Write structured findings to file with severity, location, effort, recommendations\n- Calculate compliance score (X\u002F10) for Transaction Correctness category\n\n## Inputs\n\n**MANDATORY READ:** Load `references\u002Faudit_worker_core_contract.md`.\nTool policy: follow host AGENTS.md MCP preferences; load `references\u002Fmcp_tool_preferences.md` and `references\u002Fmcp_integration_patterns.md` only when host policy is absent or MCP behavior is unclear.\n\nReceives `contextStore` with: `tech_stack`, `best_practices`, `db_config` (database type, ORM settings, trigger\u002Fnotify patterns), `codebase_root`, `output_dir`.\n\n**Domain-aware:** Supports `domain_mode` + `current_domain`.\n\nUse `hex-graph` first when reference chains or call paths materially improve transaction analysis. Use `hex-line` first for local code\u002Fconfig reads when available. If MCP is unavailable, unsupported, or not indexed, continue with built-in `Read\u002FGrep\u002FGlob\u002FBash` and state the fallback in the report.\n\n## Workflow\n\nDetection policy: use two-layer detection (candidate scan, then context verification); load `references\u002Ftwo_layer_detection.md` only when the verification method is ambiguous.\n\n1) **Parse context from contextStore**\n   - Extract tech_stack, best_practices, db_config, output_dir\n   - Determine scan_path\n\n2) **Discover transaction infrastructure**\n   - Find migration files with triggers (`pg_notify`, `CREATE TRIGGER`, `NOTIFY`)\n   - Find session\u002Ftransaction configuration (`expire_on_commit`, `autocommit`, isolation level)\n   - Map trigger-affected tables\n\n3) **Scan codebase for violations**\n   - Trace UPDATE paths for trigger-affected tables\n   - Analyze transaction boundaries (begin\u002Fcommit scope)\n   - Check error handling around commits\n\n4) **Collect findings with severity, location, effort, recommendation**\n\n5) **Calculate score using penalty algorithm**\n\n6) **Write Report:** Build full markdown report in memory per `references\u002Ftemplates\u002Faudit_worker_report_template.md`, write to `{output_dir}\u002Fln-652--global.md` in single Write call\n\n7) **Return Summary:** Return minimal summary to coordinator (see Output Format)\n\n## Audit Rules (Priority: HIGH)\n\n### 1. Missing Intermediate Commits\n**What:** UPDATE without commit when DB trigger\u002FNOTIFY depends on transaction commit\n\n**Detection:**\n- **Step 1:** Find triggers in migrations:\n  - Grep for `pg_notify|NOTIFY|CREATE TRIGGER|CREATE OR REPLACE FUNCTION.*trigger` in `alembic\u002Fversions\u002F`, `migrations\u002F`\n  - Extract: trigger function name, table name, trigger event (INSERT\u002FUPDATE)\n- **Step 2:** Find code that UPDATEs trigger-affected tables:\n  - Grep for `repo.*update|session\\.execute.*update|\\.progress|\\.status` related to trigger tables\n- **Step 3:** Check for `commit()` between sequential updates:\n  - If multiple UPDATEs to trigger table occur in a loop\u002Fsequence without intermediate `commit()`, NOTIFY events are deferred until final commit\n  - Real-time progress tracking breaks without intermediate commits\n\n**Severity:**\n- **CRITICAL:** Missing commit for NOTIFY\u002FLISTEN-based real-time features (SSE, WebSocket)\n- **HIGH:** Missing commit for triggers that update materialized data\n\n**Exception:** Single atomic operation with no intermediate observable state -> downgrade CRITICAL to MEDIUM. Transaction scope documented as intentional (ADR, architecture comment) -> downgrade one level\n\n**Recommendation:**\n- Add `session.commit()` at progress milestones (throttled: every N%, every T seconds)\n- Or move real-time notifications out of DB triggers (Redis pub\u002Fsub, in-process events)\n\n**Effort:** S-M (add strategic commits or redesign notification path)\n\n### 2. Transaction Scope Too Wide\n**What:** Single transaction wraps unrelated operations, including slow external calls\n\n**Detection:**\n- Find `async with session.begin()` or explicit transaction blocks\n- Check if block contains external calls: `await httpx.`, `await aiohttp.`, `await requests.`, `await grpc.`\n- Check if block contains file I\u002FO: `open(`, `.read(`, `.write(`\n- Pattern: DB write + external API call + another DB write in same transaction\n\n**Severity:**\n- **HIGH:** External HTTP\u002FgRPC call inside transaction (holds DB connection during network latency)\n- **MEDIUM:** File I\u002FO inside transaction\n\n**Recommendation:** Split into separate transactions; use Saga\u002FOutbox pattern for cross-service consistency\n\n**Effort:** M-L (restructure transaction boundaries)\n\n### 3. Transaction Scope Too Narrow\n**What:** Logically atomic operations split across multiple commits\n\n**Detection:**\n- Multiple `session.commit()` calls for operations that should be atomic\n- Pattern: create parent entity, commit, create child entities, commit (should be single transaction)\n- Pattern: update status + create audit log in separate commits\n\n**Severity:**\n- **HIGH:** Parent-child creation in separate commits (orphan risk on failure)\n- **MEDIUM:** Related updates in separate commits (inconsistent state on failure)\n\n**Recommendation:** Wrap related operations in single transaction using `async with session.begin()` or unit-of-work pattern\n\n**Effort:** M (restructure commit boundaries)\n\n### 4. Missing Rollback Handling\n**What:** `session.commit()` without proper error handling and rollback\n\n**Detection:**\n- Find `session.commit()` not inside `try\u002Fexcept` block or context manager\n- Find `session.commit()` in `try` without `session.rollback()` in `except`\n- Pattern: bare `await session.commit()` in service methods\n- Exception: `async with session.begin()` auto-rollbacks (safe)\n\n**Severity:**\n- **MEDIUM:** Missing rollback (session left in broken state on failure)\n- **LOW:** Missing explicit rollback when using context manager (auto-handled)\n\n**Recommendation:** Use `async with session.begin()` (auto-rollback), or add explicit `try\u002Fexcept\u002Frollback` pattern\n\n**Effort:** S (wrap in context manager or add error handling)\n\n### 5. Long-Held Transaction\n**What:** Transaction open during slow\u002Fblocking operations\n\n**Detection:**\n- Measure scope: count lines between transaction start and commit\n- Flag if >50 lines of code between `begin()` and `commit()`\n- Flag if transaction contains `await` calls to external services (network latency)\n- Flag if transaction contains `time.sleep()` or `asyncio.sleep()`\n\n**Severity:**\n- **HIGH:** Transaction held during external API call (connection pool exhaustion risk)\n- **MEDIUM:** Transaction spans >50 lines (complex logic, high chance of lock contention)\n\n**Recommendation:** Minimize transaction scope; prepare data before opening transaction, commit immediately after DB operations\n\n**Effort:** M (restructure code to minimize transaction window)\n\n### 6. Event Channel Name Consistency\n**What:** Publisher channel\u002Ftopic name does not match subscriber channel\u002Ftopic name\n\n**Detection:**\n- **Step 1:** Collect publisher channel names (extend Phase 2 trigger discovery):\n  - Migration triggers: extract string argument from `pg_notify('channel_name', ...)`, `NOTIFY channel_name`\n  - Application code: Grep for `\\.publish\\([\"']|\\.emit\\([\"']|redis.*publish\\([\"']|\\.send_to\\([\"']` in `src\u002F`, `app\u002F`\n  - Extract: `{channel_name, source_file, source_line, technology}`\n- **Step 2:** Collect subscriber channel names:\n  - PostgreSQL: Grep for `LISTEN\\s+(\\w+)` in application code (not just migrations)\n  - Redis: Grep for `\\.subscribe\\([\"']([^\"']+)` in `src\u002F`, `app\u002F`\n  - EventEmitter\u002FWebSocket: Grep for `\\.on\\([\"']([^\"']+)` in handler\u002Flistener directories\n  - Extract: `{channel_name, source_file, source_line, technology}`\n- **Step 3:** Cross-reference publishers vs subscribers:\n  - Exact match: `publisher.channel_name == subscriber.channel_name` -> OK\n  - Near-miss: Levenshtein distance \u003C= 2 OR one is substring of the other -> flag as MISMATCH\n  - Orphaned publisher: channel exists in publishers but not in subscribers -> flag as ORPHAN\n  - Orphaned subscriber: channel exists in subscribers but not in publishers -> flag as ORPHAN\n\n**Layer 2 Context Analysis (MANDATORY):**\n- If channel name comes from shared config constant or env var (e.g., `CHANNEL = os.environ[\"EVENT_CHANNEL\"]`) and both publisher and subscriber use same source -> NOT a mismatch\n- If channel uses dynamic suffix pattern (e.g., `job_events:{job_id}`) and both sides use same template -> NOT orphaned\n- Exclude test files (`**\u002Ftest*\u002F**`, `**\u002F*.test.*`) from both publisher and subscriber discovery\n\n**Severity:**\n- **CRITICAL:** Channel name mismatch (near-miss: publisher sends to `job_events`, subscriber listens on `job_event`)\n- **HIGH:** Orphaned publisher -- events sent but never consumed (data loss risk if events carry state changes)\n- **MEDIUM:** Orphaned subscriber -- listener registered but no publisher found (dead code or future feature)\n\n**Recommendation:**\n- For mismatches: unify channel name to a single constant shared between publisher and subscriber\n- For orphaned publishers: add subscriber or remove unused NOTIFY\u002Fpublish\n- For orphaned subscribers: add publisher or remove dead listener\n\n**Effort:** S (fix typo\u002Fadd constant) to M (design missing subscriber\u002Fpublisher)\n\n## Scoring Algorithm\n\n**MANDATORY READ:** Load `references\u002Faudit_scoring.md`.\n\n## Output Format\n\n**MANDATORY READ:** Load `references\u002Ftemplates\u002Faudit_worker_report_template.md`.\n\nWrite JSON summary per `references\u002Faudit_summary_contract.md`. In managed mode the caller passes both `runId` and `summaryArtifactPath`; in standalone mode the worker generates its own run-scoped artifact path per shared contract.\n\nWrite report to `{output_dir}\u002Fln-652--global.md` with `category: \"Transaction Correctness\"` and checks: missing_intermediate_commits, scope_too_wide, scope_too_narrow, missing_rollback, long_held_transaction, event_channel_consistency.\n\nReturn summary per `references\u002Faudit_summary_contract.md`.\n\nWhen `summaryArtifactPath` is absent, write the standalone runtime summary under `.hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Fevaluation-worker\u002F{worker}--{identifier}.json` and optionally echo the same summary in structured output.\n```\nReport written: .hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Faudit-report\u002Fln-652--global.md\nScore: X.X\u002F10 | Issues: N (C:N H:N M:N L:N)\n```\n\n## Critical Rules\n\nApply the already-loaded `references\u002Faudit_worker_core_contract.md`.\n\n- **Do not auto-fix:** Report only\n- **Trigger discovery first:** Always scan migrations for triggers\u002FNOTIFY before analyzing transaction patterns\n- **ORM-aware:** Check if ORM context manager auto-rollbacks (`async with session.begin()` is safe)\n- **Exclude test transactions:** Do not flag test fixtures with manual commit\u002Frollback\n- **Database-specific:** PostgreSQL NOTIFY semantics differ from MySQL event scheduler\n\n## Definition of Done\n\nApply the already-loaded `references\u002Faudit_worker_core_contract.md`.\n\n- [ ] contextStore parsed successfully (including output_dir)\n- [ ] scan_path determined\n- [ ] Trigger\u002FNOTIFY infrastructure discovered from migrations\n- [ ] All 6 checks completed:\n  - missing intermediate commits, scope too wide, scope too narrow, missing rollback, long-held, event channel consistency\n- [ ] Findings collected with severity, location, effort, recommendation\n- [ ] Score calculated using penalty algorithm\n- [ ] Report written to `{output_dir}\u002Fln-652--global.md` (atomic single Write call)\n- [ ] Summary written per contract\n\n## Reference Files\n\n- **Audit output schema:** `references\u002Faudit_output_schema.md`\n\n---\n**Version:** 1.1.0\n**Last Updated:** 2026-03-15\n","> **Paths:** File paths (`references\u002F`, `..\u002Fln-*`) are relative to this skill directory.\n\n# Transaction Correctness Auditor (L3 Worker)\n\n**Type:** L3 Worker\n\nSpecialized worker auditing database transaction patterns for correctness, scope, and trigger interaction.\n\n## Purpose & Scope\n\n- Audit **transaction correctness** (Priority: HIGH)\n- Check commit patterns, transaction boundaries, rollback handling, trigger\u002Fnotify semantics\n- Write structured findings to file with severity, location, effort, recommendations\n- Calculate compliance score (X\u002F10) for Transaction Correctness category\n\n## Inputs\n\n**MANDATORY READ:** Load `references\u002Faudit_worker_core_contract.md`.\nTool policy: follow host AGENTS.md MCP preferences; load `references\u002Fmcp_tool_preferences.md` and `references\u002Fmcp_integration_patterns.md` only when host policy is absent or MCP behavior is unclear.\n\nReceives `contextStore` with: `tech_stack`, `best_practices`, `db_config` (database type, ORM settings, trigger\u002Fnotify patterns), `codebase_root`, `output_dir`.\n\n**Domain-aware:** Supports `domain_mode` + `current_domain`.\n\nUse `hex-graph` first when reference chains or call paths materially improve transaction analysis. Use `hex-line` first for local code\u002Fconfig reads when available. If MCP is unavailable, unsupported, or not indexed, continue with built-in `Read\u002FGrep\u002FGlob\u002FBash` and state the fallback in the report.\n\n## Workflow\n\nDetection policy: use two-layer detection (candidate scan, then context verification); load `references\u002Ftwo_layer_detection.md` only when the verification method is ambiguous.\n\n1) **Parse context from contextStore**\n   - Extract tech_stack, best_practices, db_config, output_dir\n   - Determine scan_path\n\n2) **Discover transaction infrastructure**\n   - Find migration files with triggers (`pg_notify`, `CREATE TRIGGER`, `NOTIFY`)\n   - Find session\u002Ftransaction configuration (`expire_on_commit`, `autocommit`, isolation level)\n   - Map trigger-affected tables\n\n3) **Scan codebase for violations**\n   - Trace UPDATE paths for trigger-affected tables\n   - Analyze transaction boundaries (begin\u002Fcommit scope)\n   - Check error handling around commits\n\n4) **Collect findings with severity, location, effort, recommendation**\n\n5) **Calculate score using penalty algorithm**\n\n6) **Write Report:** Build full markdown report in memory per `references\u002Ftemplates\u002Faudit_worker_report_template.md`, write to `{output_dir}\u002Fln-652--global.md` in single Write call\n\n7) **Return Summary:** Return minimal summary to coordinator (see Output Format)\n\n## Audit Rules (Priority: HIGH)\n\n### 1. Missing Intermediate Commits\n**What:** UPDATE without commit when DB trigger\u002FNOTIFY depends on transaction commit\n\n**Detection:**\n- **Step 1:** Find triggers in migrations:\n  - Grep for `pg_notify|NOTIFY|CREATE TRIGGER|CREATE OR REPLACE FUNCTION.*trigger` in `alembic\u002Fversions\u002F`, `migrations\u002F`\n  - Extract: trigger function name, table name, trigger event (INSERT\u002FUPDATE)\n- **Step 2:** Find code that UPDATEs trigger-affected tables:\n  - Grep for `repo.*update|session\\.execute.*update|\\.progress|\\.status` related to trigger tables\n- **Step 3:** Check for `commit()` between sequential updates:\n  - If multiple UPDATEs to trigger table occur in a loop\u002Fsequence without intermediate `commit()`, NOTIFY events are deferred until final commit\n  - Real-time progress tracking breaks without intermediate commits\n\n**Severity:**\n- **CRITICAL:** Missing commit for NOTIFY\u002FLISTEN-based real-time features (SSE, WebSocket)\n- **HIGH:** Missing commit for triggers that update materialized data\n\n**Exception:** Single atomic operation with no intermediate observable state -> downgrade CRITICAL to MEDIUM. Transaction scope documented as intentional (ADR, architecture comment) -> downgrade one level\n\n**Recommendation:**\n- Add `session.commit()` at progress milestones (throttled: every N%, every T seconds)\n- Or move real-time notifications out of DB triggers (Redis pub\u002Fsub, in-process events)\n\n**Effort:** S-M (add strategic commits or redesign notification path)\n\n### 2. Transaction Scope Too Wide\n**What:** Single transaction wraps unrelated operations, including slow external calls\n\n**Detection:**\n- Find `async with session.begin()` or explicit transaction blocks\n- Check if block contains external calls: `await httpx.`, `await aiohttp.`, `await requests.`, `await grpc.`\n- Check if block contains file I\u002FO: `open(`, `.read(`, `.write(`\n- Pattern: DB write + external API call + another DB write in same transaction\n\n**Severity:**\n- **HIGH:** External HTTP\u002FgRPC call inside transaction (holds DB connection during network latency)\n- **MEDIUM:** File I\u002FO inside transaction\n\n**Recommendation:** Split into separate transactions; use Saga\u002FOutbox pattern for cross-service consistency\n\n**Effort:** M-L (restructure transaction boundaries)\n\n### 3. Transaction Scope Too Narrow\n**What:** Logically atomic operations split across multiple commits\n\n**Detection:**\n- Multiple `session.commit()` calls for operations that should be atomic\n- Pattern: create parent entity, commit, create child entities, commit (should be single transaction)\n- Pattern: update status + create audit log in separate commits\n\n**Severity:**\n- **HIGH:** Parent-child creation in separate commits (orphan risk on failure)\n- **MEDIUM:** Related updates in separate commits (inconsistent state on failure)\n\n**Recommendation:** Wrap related operations in single transaction using `async with session.begin()` or unit-of-work pattern\n\n**Effort:** M (restructure commit boundaries)\n\n### 4. Missing Rollback Handling\n**What:** `session.commit()` without proper error handling and rollback\n\n**Detection:**\n- Find `session.commit()` not inside `try\u002Fexcept` block or context manager\n- Find `session.commit()` in `try` without `session.rollback()` in `except`\n- Pattern: bare `await session.commit()` in service methods\n- Exception: `async with session.begin()` auto-rollbacks (safe)\n\n**Severity:**\n- **MEDIUM:** Missing rollback (session left in broken state on failure)\n- **LOW:** Missing explicit rollback when using context manager (auto-handled)\n\n**Recommendation:** Use `async with session.begin()` (auto-rollback), or add explicit `try\u002Fexcept\u002Frollback` pattern\n\n**Effort:** S (wrap in context manager or add error handling)\n\n### 5. Long-Held Transaction\n**What:** Transaction open during slow\u002Fblocking operations\n\n**Detection:**\n- Measure scope: count lines between transaction start and commit\n- Flag if >50 lines of code between `begin()` and `commit()`\n- Flag if transaction contains `await` calls to external services (network latency)\n- Flag if transaction contains `time.sleep()` or `asyncio.sleep()`\n\n**Severity:**\n- **HIGH:** Transaction held during external API call (connection pool exhaustion risk)\n- **MEDIUM:** Transaction spans >50 lines (complex logic, high chance of lock contention)\n\n**Recommendation:** Minimize transaction scope; prepare data before opening transaction, commit immediately after DB operations\n\n**Effort:** M (restructure code to minimize transaction window)\n\n### 6. Event Channel Name Consistency\n**What:** Publisher channel\u002Ftopic name does not match subscriber channel\u002Ftopic name\n\n**Detection:**\n- **Step 1:** Collect publisher channel names (extend Phase 2 trigger discovery):\n  - Migration triggers: extract string argument from `pg_notify('channel_name', ...)`, `NOTIFY channel_name`\n  - Application code: Grep for `\\.publish\\([\"']|\\.emit\\([\"']|redis.*publish\\([\"']|\\.send_to\\([\"']` in `src\u002F`, `app\u002F`\n  - Extract: `{channel_name, source_file, source_line, technology}`\n- **Step 2:** Collect subscriber channel names:\n  - PostgreSQL: Grep for `LISTEN\\s+(\\w+)` in application code (not just migrations)\n  - Redis: Grep for `\\.subscribe\\([\"']([^\"']+)` in `src\u002F`, `app\u002F`\n  - EventEmitter\u002FWebSocket: Grep for `\\.on\\([\"']([^\"']+)` in handler\u002Flistener directories\n  - Extract: `{channel_name, source_file, source_line, technology}`\n- **Step 3:** Cross-reference publishers vs subscribers:\n  - Exact match: `publisher.channel_name == subscriber.channel_name` -> OK\n  - Near-miss: Levenshtein distance \u003C= 2 OR one is substring of the other -> flag as MISMATCH\n  - Orphaned publisher: channel exists in publishers but not in subscribers -> flag as ORPHAN\n  - Orphaned subscriber: channel exists in subscribers but not in publishers -> flag as ORPHAN\n\n**Layer 2 Context Analysis (MANDATORY):**\n- If channel name comes from shared config constant or env var (e.g., `CHANNEL = os.environ[\"EVENT_CHANNEL\"]`) and both publisher and subscriber use same source -> NOT a mismatch\n- If channel uses dynamic suffix pattern (e.g., `job_events:{job_id}`) and both sides use same template -> NOT orphaned\n- Exclude test files (`**\u002Ftest*\u002F**`, `**\u002F*.test.*`) from both publisher and subscriber discovery\n\n**Severity:**\n- **CRITICAL:** Channel name mismatch (near-miss: publisher sends to `job_events`, subscriber listens on `job_event`)\n- **HIGH:** Orphaned publisher -- events sent but never consumed (data loss risk if events carry state changes)\n- **MEDIUM:** Orphaned subscriber -- listener registered but no publisher found (dead code or future feature)\n\n**Recommendation:**\n- For mismatches: unify channel name to a single constant shared between publisher and subscriber\n- For orphaned publishers: add subscriber or remove unused NOTIFY\u002Fpublish\n- For orphaned subscribers: add publisher or remove dead listener\n\n**Effort:** S (fix typo\u002Fadd constant) to M (design missing subscriber\u002Fpublisher)\n\n## Scoring Algorithm\n\n**MANDATORY READ:** Load `references\u002Faudit_scoring.md`.\n\n## Output Format\n\n**MANDATORY READ:** Load `references\u002Ftemplates\u002Faudit_worker_report_template.md`.\n\nWrite JSON summary per `references\u002Faudit_summary_contract.md`. In managed mode the caller passes both `runId` and `summaryArtifactPath`; in standalone mode the worker generates its own run-scoped artifact path per shared contract.\n\nWrite report to `{output_dir}\u002Fln-652--global.md` with `category: \"Transaction Correctness\"` and checks: missing_intermediate_commits, scope_too_wide, scope_too_narrow, missing_rollback, long_held_transaction, event_channel_consistency.\n\nReturn summary per `references\u002Faudit_summary_contract.md`.\n\nWhen `summaryArtifactPath` is absent, write the standalone runtime summary under `.hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Fevaluation-worker\u002F{worker}--{identifier}.json` and optionally echo the same summary in structured output.\n```\nReport written: .hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Faudit-report\u002Fln-652--global.md\nScore: X.X\u002F10 | Issues: N (C:N H:N M:N L:N)\n```\n\n## Critical Rules\n\nApply the already-loaded `references\u002Faudit_worker_core_contract.md`.\n\n- **Do not auto-fix:** Report only\n- **Trigger discovery first:** Always scan migrations for triggers\u002FNOTIFY before analyzing transaction patterns\n- **ORM-aware:** Check if ORM context manager auto-rollbacks (`async with session.begin()` is safe)\n- **Exclude test transactions:** Do not flag test fixtures with manual commit\u002Frollback\n- **Database-specific:** PostgreSQL NOTIFY semantics differ from MySQL event scheduler\n\n## Definition of Done\n\nApply the already-loaded `references\u002Faudit_worker_core_contract.md`.\n\n- [ ] contextStore parsed successfully (including output_dir)\n- [ ] scan_path determined\n- [ ] Trigger\u002FNOTIFY infrastructure discovered from migrations\n- [ ] All 6 checks completed:\n  - missing intermediate commits, scope too wide, scope too narrow, missing rollback, long-held, event channel consistency\n- [ ] Findings collected with severity, location, effort, recommendation\n- [ ] Score calculated using penalty algorithm\n- [ ] Report written to `{output_dir}\u002Fln-652--global.md` (atomic single Write call)\n- [ ] Summary written per contract\n\n## Reference Files\n\n- **Audit output schema:** `references\u002Faudit_output_schema.md`\n\n---\n**Version:** 1.1.0\n**Last Updated:** 2026-03-15\n",{"name":5,"license":15,"description":7,"allowed-tools":49},"Read, Grep, Glob, Bash, mcp__hex-graph__find_references, mcp__hex-graph__trace_paths, mcp__hex-line__read_file, mcp__hex-line__grep_search, mcp__hex-line__outline","main","fbfb242f793fdf040f3a1a6b100896c188c228c8","_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor",1,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog","https:\u002F\u002Fgithub.com\u002Fvitalikpestov","Listing on crypto exchanges","2026-06-15 22:12:56",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add vitalikpestov\u002FSkills-Catalog --skill ln-652-transaction-correctness-auditor",{"tool":64,"command":65},"bunx","bunx skills add vitalikpestov\u002FSkills-Catalog --skill ln-652-transaction-correctness-auditor",{"tool":67,"command":68},"pnpm","pnpm dlx skills add vitalikpestov\u002FSkills-Catalog --skill ln-652-transaction-correctness-auditor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002FSKILL.md",true,[72,78,82,86,90,94,98,102],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Faudit_output_schema.md","REFERENCE","参考文档",4439,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002Freferences\u002Faudit_output_schema.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Faudit_scoring.md",1117,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002Freferences\u002Faudit_scoring.md",{"path":83,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Faudit_summary_contract.md",2206,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002Freferences\u002Faudit_summary_contract.md",{"path":87,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Faudit_worker_core_contract.md",1851,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002Freferences\u002Faudit_worker_core_contract.md",{"path":91,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fmcp_integration_patterns.md",1567,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002Freferences\u002Fmcp_integration_patterns.md",{"path":95,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fmcp_tool_preferences.md",2338,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002Freferences\u002Fmcp_tool_preferences.md",{"path":99,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Ftemplates\u002Faudit_worker_report_template.md",1686,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002Freferences\u002Ftemplates\u002Faudit_worker_report_template.md",{"path":103,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Ftwo_layer_detection.md",1504,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fcodebase-audit-suite\u002Fskills\u002Fln-652-transaction-correctness-auditor\u002Freferences\u002Ftwo_layer_detection.md",[107,145,169,185,208,241],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":125,"publishedAt":144},"01M71V1MC994P553631JZSWVYD","solana-dev","Use when user asks to \"build a Solana dapp\", \"write an Anchor program\", \"create a token\", \"debug Solana errors\", \"set up wallet connection\", \"test my Solana program\", \"deploy to devnet\", or \"explain Solana concepts\" (rent, accounts, PDAs, CPIs, etc.). End-to-end Solana development playbook covering wallet connection, Anchor\u002FPinocchio programs, Codama client generation, LiteSVM\u002FMollusk\u002FSurfpool testing, and security checklists. Integrates with the Solana MCP server for live documentation search. Prefers framework-kit (@solana\u002Fclient + @solana\u002Freact-hooks) for UI, wallet-standard-first connection (incl. ConnectorKit), @solana\u002Fkit for client\u002FRPC code, and @solana\u002Fweb3-compat for legacy boundaries.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Web3\u002Fsolana-dev\u002Fskill\u002FSKILL.md",[113,116,119,120],{"categoryNo":114,"categoryName":115,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":117,"categoryName":118,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":121,"categoryName":122,"taxonomyType":123,"taxonomyTypeDesc":124},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[126,127,128,129,42,130,131,132,39,133,134,135,136,137,138,139,140,141,142,143],"dev","solana dev","solana","Wallet","testing","solana cli","kit","web3","react","create","server","write","playbook","live","security","ui","concepts","toolchain","2026-11-10 13:02:02",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":144},"01M71TYQPHE2YGKTT7DG9QCW3K","generating-trading-signals","Generate trading signals using technical indicators (RSI, MACD, Bollinger Bands, etc.).\nCombines multiple indicators into composite signals with confidence scores.\nUse when analyzing assets for trading opportunities or checking technical indicators.\nTrigger with phrases like \"get trading signals\", \"check indicators\", \"analyze for entry\",\n\"scan for opportunities\", \"generate buy\u002Fsell signals\", or \"technical analysis\".","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Trading-Finance\u002Fgenerating-trading-signals\u002FSKILL.md",[],[152,153,154,155,156,157,158,159,160,29,161,162,163,38,37,164,165,166,167,168],"generating trading signals","signals","trading signals","trading","get","technical indicators","for","scan","rsi","python","technical","use","analysis","code","io","check","analyze",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":144},"01M71TY4CR3GKGQ3M12X9WN95Y","prediction-monitor","Prediction Monitor - Auto-activating skill for ML Deployment.\nTriggers on: prediction monitor, prediction monitor\nPart of the ML Deployment skill category.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Trading-Finance\u002FAI Predictions\u002Fprediction-monitor\u002FSKILL.md",[],[176,177,178,158,179,32,137,180,181,182,183,184,37],"prediction","monitor","prediction monitor","deployment","edit","triggers","grep","auto","ml",{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":191,"publishedAt":144},"01M71TXD9MYXZC39HCPP909HTZ","strategy-advisor","High-level strategic thinking and business decision guidance for planning and direction-setting.\nUse when: making strategic decisions, evaluating business options, setting direction, analyzing\ntrade-offs, or when user mentions strategy, business planning, competitive analysis, or long-term planning.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Fstrategy-advisor\u002FSKILL.md",[],[192,193,194,195,196,197,198,199,200,158,201,202,203,163,204,205,38,206,164,207],"strategy advisor","strategy","advisor","competitive","setting","thinking","planning","direction","trade-offs","long","decision","strategic","business","apps","decisions","trade",{"skillNo":209,"name":210,"nameZh":6,"description":211,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":212,"sourceHtmlUrl":213,"categories":214,"keywords":221,"publishedAt":144},"01M71TWHBT2R1P1FNWTW67ZREP","app-paywall-pilot","Design, audit, debug, and implement App Store-compliant mobile paywalls, subscription flows, pricing screens, trials, offers, feature gates, and subscription lifecycle UX. Use when the user asks to audit my paywall, fix App Store 3.1.2 rejection, improve trial-to-paid, choose plans\u002Fprices\u002Ftrials, review RevenueCat\u002FAdapty\u002FApphud\u002FSuperwall setup, calculate LTV\u002FROAS, or build paywall implementation.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffrom-dosesync\u002Fapp-paywall-pilot\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffrom-dosesync\u002Fapp-paywall-pilot\u002FSKILL.md",[215,218],{"categoryNo":216,"categoryName":217,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":219,"categoryName":220,"taxonomyType":123,"taxonomyTypeDesc":124},"01JBSEEDCAT000000000000032","设计师",[222,223,224,225,226,227,228,229,230,231,232,233,38,234,235,236,237,238,239,240],"app","paywall","app paywall pilot","paid","paywalls","prices","choose","flows","fix","improve","design","app store","review","audit","ux","subscription","mobile","my","calculate",{"skillNo":242,"name":243,"nameZh":6,"description":244,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":245,"licenseFileUrl":246,"sourceHtmlUrl":247,"categories":248,"keywords":251,"publishedAt":144},"01M71TWET8GFKEB7ZHJPMQX29V","figma","Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffigma\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffigma\u002FSKILL.md",[249,250],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":219,"categoryName":220,"taxonomyType":123,"taxonomyTypeDesc":124},[243,252,253,254,255,29,232,39,163,38,256,257,165,258,136,259,260,261,262,263],"fetch","ids","mcp setup","translate","mcp server","Variables","task","Nodes","figma mcp","code implementation","node","assets"]