ability-analysis
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
Protocol Type Trigger outcome_determinism - detected when EITHER of these code patterns are present - - Selection from finite depletable pool with fallback behavior (while(full)...
$ npx -y skills add PlamenTSV/plamen --skill outcome-determinism --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/outcome-determinismContext preview
The summary Claude sees to decide when to auto-load this skill.
Protocol Type Trigger outcome_determinism - detected when EITHER of these code patterns are present - - Selection from finite depletable pool with fallback behavior (while(full)...
name: "outcome-determinism" description: "Protocol Type Trigger outcome_determinism - detected when EITHER of these code patterns are present - - Selection from finite depletable pool with fallback behavior (while(full)..."
> **Protocol Type Trigger**: `outcome_determinism` - detected when EITHER of these code patterns are present: > - Selection from finite depletable pool with fallback behavior (`while(full) next`, `modulo` with shrinking domain, category/slot/validator selection) > - Time-gated actions with observable default/fallback outcomes (`deadline`, `claimPeriod`, `defaultSelection`, `expiry` + fallback path that computes from predictable state) > **Inject Into**: Breadth agents, depth-edge-case > **Language**: All (rational actor patterns are chain-agnostic) > **Finding prefix**: `[OD-N]` > **Added in**: v1.1 > > **NOTE**: Callback selective revert (Section 1a of the original skill) and RNG consumption enumeration (Section 1b) are now ALWAYS-ON checks in the depth agent template - they do not require this injectable to trigger.
The always-on depth template already covers:
This injectable adds analysis that only applies when SPECIFIC structural patterns exist:
---
For every selection algorithm operating on a set that can shrink, grow, or be modified between selections:
| Selection Function | Pool Size | Depletion Mechanism | Fallback Behavior | Redistribution Fair? | |-------------------|-----------|--------------------|--------------------|---------------------|
**Fairness test**: When element X is removed from a pool of N:
**Common biased patterns across protocol types**:
**Quantify**: At each depletion level (1-of-N, N/2-of-N, N-1-of-N), what is the maximum probability deviation from uniform? Is it exploitable (can the actor influence which elements deplete first)?
Tag: `[VARIATION:pool N→N-K → element X probability 1/N→{new_prob} → bias={factor}x]`
For bounded parameters (caps, limits, quotas) where the bound can be LOWERED below already-accumulated state and the bound is used by a selection/iteration algorithm:
| Parameter | Setter | Current Accumulated | Can Set Below Accumulated? | Selection Algorithm Affected | What Breaks? | |-----------|--------|--------------------|--------------------------|-------|--------------|
**This extends Rule 14** (Setter Regression) specifically for selection/allocation algorithms: when a cap is lowered below the current count, does the selection algorithm's termination condition still hold? (e.g., `while (count == max)` becomes unreachable when count > max)
---
**Core question**: For each user-facing action, is the TIMING of the action exploitable by a rational self-interested actor?
For every time-gated action with a default or fallback:
| Action | Active Path | Default/Fallback Path | Default Predictable? | Default Sometimes Better? | Delay Cost | |--------|-----------|----------------------|---------------------|--------------------------|-----------|
**A rational actor will delay when ALL THREE hold**: 1. The default outcome is **predictable** (computed from observable on-chain state, not future unknowns) 2. The default is **sometimes better** than the active choice (different formula, different prices, different parameters) 3. The **cost of waiting** (opportunity cost, gas, penalty) is lower than the expected value gain
**Cross-protocol examples**:
**Methodology**: 1. Identify the active path (user calls function before deadline) 2. Identify the default path (what happens if user doesn't act - system assigns default, claim expires, fallback triggers) 3. Is the default outcome computable from CURRENT on-chain state? (If it depends on future block hash or unresolved oracle → not predictable → no strategic edge) 4. Compare: under what market/state conditions is default > active? How often do those conditions occur? 5. What does delay cost? (forfeiture, penalty, opportunity cost, gas savings)
Tag: `[TRACE:action={fn} deadline={T} → default={fallback_fn} → computed_from={state_vars} → predictable={YES/NO} → default_better_when={condition}]`
For every admin-settable parameter that affects pending or future user operations:
| Parameter | Setter | Timelock? | Event
Autonomous Web3 security auditor for Claude Code and OpenAI Codex CLI. Orchestrates 18-100 AI agents across 40+ phases to produce audit reports with verified PoC exploits — for smart contracts and L1 node-client infrastructure.
Repo: PlamenTSV/plamen
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into…
Trigger Protocol has privileged roles (admin, operator, governance, resource account owner) -…
Trigger EXTERNAL_LIB flag detected (protocol uses third-party Move dependencies) - Used by…
Trigger Pattern MONETARY_PARAMETER flag (required) - Inject Into Breadth agents (merged via…