# closed-membership-capacity-review

> A represented constructor history contradicts distinct Set memberships under a complete source closure without subsequent writers.

Canonical: https://nightshade.dicksonwu.xyz/rules/closed-membership-capacity-review.html
Release: Nightshade 0.1.1 (v0.1.1)

| Field | Value |
| --- | --- |
| Rule ID | `closed-membership-capacity-review` |
| Severity | info |
| Confidence | varies |
| Maturity | experimental |
| Selection | Opt-in |
| Policy intent | not required |
| Default enabled | no |
| Category | Other active opt-ins / Authorization, identity and membership |
| Engine facts used | constructor-to-entry-prefixes, exact-collection-capacity, complete-post-constructor-effects |
| Release | v0.1.1 |

## Selection and scope

Not selected by default. Select it with `--detectors` or the `detectors` list in nightshade.json. Either one replaces profile selection, so list every rule you want.

```sh
./.nightshade/node_modules/.bin/nightshade ./contracts --detectors closed-membership-capacity-review
./.nightshade/node_modules/.bin/nightshade detector show closed-membership-capacity-review
```

The first command runs only this rule; `--detectors` takes a comma-separated list. The second prints the rule's metadata from your installed version.

Severity is review priority. It does not express exploitability or impact. Confidence is detector metadata, not a probability. All built-in rules are experimental.

Compiler scope: the engine supports the pinned profiles 0.28.0, 0.29.0, 0.30.0, 0.31.1, 0.33.0-rc.2, 0.34.0, 0.35.0-rc.1 and 0.35.0, with ZKIR2 by default. Support for this rule can be narrower; the rule documentation below states any narrower scope.

## Corpus checks

Synthetic corpus checks for this rule in the 0.1.1 proof run. A check counts only with compiler acceptance and complete analysis.

| Positive detected | Corrected quiet | Lookalike quiet | Other negative quiet | Incomplete |
| ---: | ---: | ---: | ---: | ---: |
| 6/6 | 3/3 | 2/2 | 10/10 | 0 |

No deviations were recorded for this rule.

These are behavior checks on synthetic fixtures, not a precision or recall estimate. See [evaluation](https://nightshade.dicksonwu.xyz/evaluation.md#synthetic-corpus).

## Rule documentation

From https://github.com/DicksonWu654/nightshade/blob/v0.1.1/docs/detectors/closed-membership-capacity-review.md at v0.1.1.

Availability: **opt-in** with `--detectors closed-membership-capacity-review`;
no policy required. Severity: **info**.

This opt-in informational rule reports a represented constructor configuration
whose current native Set capacity is smaller than the gate's mandatory,
pairwise-distinct memberships. It also requires complete resolved source evidence
that no post-constructor public callable can write that whole Set root.

The source closure includes every public entry, its helpers, import instances and
callbacks. Any insert, remove or other may-write to the root prevents this
conservative certificate, including a writer callback over a zero-length vector.
An unrelated ledger writer does not prevent certification of the target root.
Unresolved callables, external contract calls, committed checkpoints and exhausted
allowances produce scoped incomplete diagnostics. Nested collection receivers
are outside this rule's whole-Set admission boundary.

The existing `configured-membership-capacity-review` remains separate: its
immediate constructor-state observation allows later configuration writers.
The new rule retains its exact capacity, current-revision, immutable operand and
mandatory pairwise-distinctness requirements. Wildcard regions, possible Boolean
alternatives and unknown storage supply no cardinality proof.

A deliberately fixed registry can match when the application intentionally makes
some operations reject for lack of capacity. The finding describes only the
represented constructor state and complete no-writer certificate; it does not
establish deployment impact or later transaction feasibility.

## Suppress a match

If a match is intentional, suppress it on the line before with the exact rule ID and a reason of at least eight characters:

```compact
// nightshade-disable-next-line closed-membership-capacity-review -- Reason this match is intentional
```

Diagnostics cannot be suppressed, and an unmatched directive for a selected rule makes analysis incomplete. See [configuration](https://nightshade.dicksonwu.xyz/configuration.md#suppress-an-intentional-match) for fingerprint suppressions and baselines.

## References

- [Rule source document at v0.1.1](https://github.com/DicksonWu654/nightshade/blob/v0.1.1/docs/detectors/closed-membership-capacity-review.md)
- [Catalog entry in rules.json](https://nightshade.dicksonwu.xyz/rules.json)
- [All rules](https://nightshade.dicksonwu.xyz/rules.md#authorization-identity-and-membership)
- [Limitations](https://nightshade.dicksonwu.xyz/limitations.md)
