semantic-gap-investigator

Trace SYNC_GAP, ACCUMULATION_EXPOSURE, and CONDITIONAL annotations to classify semantic invariants in smart contracts.

276|56|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/PlamenTSV/plamen --skill semantic-gap-investigator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semantic-gap-investigator
Source: https://github.com/PlamenTSV/plamen/tree/main/agents/skills/niche/semantic-gap-investigator
Command: npx skills add https://github.com/PlamenTSV/plamen --skill semantic-gap-investigator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identifies and analyzes semantic invariants in smart contract code, surfacing gaps where one variable is updated without corresponding updates to another, enabling focused security reviews.

Core Features & Use Cases

  • Traces SYNC_GAP, ACCUMULATION_EXPOSURE, and CONDITIONAL annotations through call graphs to locate stale reads and delayed updates.
  • Evaluates exploitability and risk with concrete-value modeling, and yields structured findings and chain summaries for remediation planning.
  • Applies to audits of complex multi-contract ecosystems, governance modules, and incentive-driven protocols where invariant consistency is critical.

Quick Start

Run the Semantic Gap Investigator on your project to identify and classify SYNC_GAP, ACCUMULATION_EXPOSURE, and CONDITIONAL annotations.

Frequently Asked Questions about semantic-gap-investigator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a semantic gap in smart contract invariants?

A semantic gap occurs when one variable updates without a corresponding update to another. Semantic invariant analysis traces these gaps across call graphs to locate stale reads and delayed updates in smart contract code.

How do I audit smart contracts for accumulation exposure and sync gaps?

You audit accumulation exposure and sync gaps by tracing flagged annotations through interaction paths across functions. Concrete-value modeling evaluates exploitability and staleness windows to produce a structured findings table for remediation.

How do I find stale reads in complex multi-contract ecosystems?

To find stale reads in multi-contract ecosystems, trace SYNC_GAP and CONDITIONAL annotations across readers and call graphs. Modeling interaction paths with concrete values determines staleness windows and quantifies exploitability risk.

Can I use semantic gap analysis for governance modules and incentive-driven protocols?

Yes, semantic gap analysis applies to governance modules and incentive-driven protocols where invariant consistency is critical. It evaluates conditional annotations and accumulation exposure to surface delayed updates requiring focused security reviews.

What is the best way to classify smart contract invariant exploitability?

The best way to classify invariant exploitability is by modeling interaction paths across functions and their readers with concrete values. This determines whether flagged semantic gaps are exploitable, benign, or stale.

Why do delayed variable updates create security risks in smart contracts?

Delayed variable updates create security risks because they leave stale reads exposed within staleness windows. Semantic gap analysis identifies these delayed updates across functions to quantify risk and highlight remediation opportunities.