Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions docs/adr/0011-public-api-and-object-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ The public API must reflect the methodological separation between structural dis

## Decision

The normative alpha-stage public flow is:
The normative alpha-stage low-level public flow is:

```python
mis_set = misda.discover(Y, ...)
misda.evaluate(mis_set, metrics=(...), candidates=...)
ranking = misda.rank(mis_set, policy="size_span")
```

This low-level flow remains valid for scientific instrumentation and advanced use, but ADR 0022 supersedes it as the canonical user-facing workflow with `profile(Y) -> discovery(profile)`.
This low-level flow remains valid for scientific instrumentation and advanced use. ADR 0022 supersedes it as the canonical user-facing flow with the additional profile stage while preserving the same discovery/ranking separation:

The canonical low-level structural ranking policy name is governed by ADR 0017.
```python
profile = misda.profile(Y)
mis_set = misda.discovery(profile)
ranking = misda.rank(mis_set)
```

The canonical structural ordering policy name is governed by ADR 0017. The public default policy of the separate `rank()` operation is governed by ADR 0021/0022.

### MISSet

Expand All @@ -44,9 +50,9 @@ These quantities are deliberately distinct.

## Invariants

- `discover()` does not accept ranking policy;
- `discover()` and high-level `discovery()` do not accept ranking policy;
- `evaluate()` does not change candidate membership, graphs, dimensions, or canonical order;
- `rank()` does not reorder or mutate the owning `MISSet`;
- `rank()` does not reorder or mutate the owning `MISSet` structurally;
- integer ranking access returns underlying candidates; slicing returns a ranking view;
- candidate canonical positions remain stable for the life of the `MISSet`;
- selected dimension belongs to `Ranking`, not `MISSet`.
Expand All @@ -67,4 +73,4 @@ Do not reintroduce discovery-time ranking policy, intrinsic candidate rank, a `r

## Verification

API contract tests should cover ownership, indexing/slicing semantics, object identity, immutability of canonical positions, and absence of discovery mutation after evaluation/ranking.
API contract tests should cover ownership, indexing/slicing semantics, object identity, immutability of canonical positions, absence of ranking-policy parameters on discovery, and absence of discovery mutation after evaluation/ranking.
58 changes: 40 additions & 18 deletions docs/adr/0017-size-span-canonical-ranking.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ADR 0017 — Size-span canonical structural ranking

- Status: Accepted
- Status: Accepted; public `rank()` default clause superseded by ADR 0022
- Recorded: 2026-09-16
- Supersedes: ADR 0008
- Tracking issue: #53
Expand Down Expand Up @@ -40,7 +40,7 @@ simpler two-criterion policy.

## Decision

The canonical structural ranking policy is named `size_span` and compares
The canonical **structural** ranking policy is named `size_span` and compares
candidates lexicographically by:

```text
Expand All @@ -52,8 +52,19 @@ A deterministic label-based tie-break may order otherwise equal candidates for
reproducibility, but it does not create a scientific distinction. Candidates
with equal `size` and equal `span` belong to the same scientific rank group.

`misda.rank(mis_set)` is equivalent to
`misda.rank(mis_set, policy="size_span")`.
Discovery stores this canonical structural order in the `MISSet`, and the
explicit ranking call

```python
misda.rank(mis_set, policy="size_span")
```

reproduces it.

The original statement that `misda.rank(mis_set)` defaults to `size_span` is
superseded by ADR 0022. The public ranking default is now
`dominance_preservation`; that change does not alter the canonical structural
order owned by discovery.

The previous exported constant name `STRUCTURAL_COVERAGE` may remain as a
compatibility alias, but its value resolves to the canonical `size_span` policy.
Expand All @@ -62,20 +73,25 @@ The literal policy name `"structural_coverage"` is not normative.
## Rationale

The policy name should describe the quantities that actually determine the
scientific ranking. Retaining redundant criteria in the ranking key gives the
false impression that multiple independent forms of structural coverage are
being combined when, for maximal independent sets, they cannot change the
ordering.
scientific structural ranking. Retaining redundant criteria in the ranking key
gives the false impression that multiple independent forms of structural
coverage are being combined when, for maximal independent sets, they cannot
change the ordering.

Cardinality remains first because it selects the largest mutually independent
objective subsets. `span` then distinguishes candidates of equal cardinality by
the total number of positive structural adjacencies connecting retained and
excluded objectives.

Separating the canonical structural order from the public preference-ranking
default also preserves ADR 0007: discovery owns structural ordering, while
`rank()` may create a different policy-dependent view without changing the
`MISSet`.

## Descriptive structural metrics

This decision changes the ranking key, not the candidate metric model.
`neighborhood`, `neighborhood_ratio`, `avg_external_degree`, and
This decision changes the structural ranking key, not the candidate metric
model. `neighborhood`, `neighborhood_ratio`, `avg_external_degree`, and
`avg_internal_degree` may remain available as descriptive or audit quantities.
Their presence in reports or the public object model must not imply that they
are independent ranking criteria.
Expand All @@ -87,16 +103,19 @@ metrics are useful to display.

## Invariants

- the canonical policy name is `size_span`;
- scientific ordering is determined only by `size` descending and then `span`
descending;
- scientific tie groups are determined by equality of `size` and `span`;
- the canonical structural policy name is `size_span`;
- scientific structural ordering is determined only by `size` descending and
then `span` descending;
- scientific structural tie groups are determined by equality of `size` and
`span`;
- deterministic label ordering is operational only and must not split a
scientific tie group;
- complete MIS discovery is unchanged;
- ranking does not prune or alter the discovered candidate universe;
- `structural_dimension` remains the independence number of `G+` and is not
redefined by ranking.
redefined by ranking;
- the public default of `rank()` may differ from the canonical structural order
without changing any discovery output.

## Behavioral preservation

Expand All @@ -120,10 +139,13 @@ rule.

Tests should verify:

1. the default and explicit public policy name is `size_span`;
2. the sort key is equivalent to descending `size`, then descending `span`;
1. the canonical structural policy name is `size_span` and explicit
`policy="size_span"` reproduces the stored structural order;
2. the structural sort key is equivalent to descending `size`, then descending
`span`;
3. candidates with equal `size` and `span` remain in the same scientific tie
group even when deterministic labels differ;
4. representative graphs produce the same candidate order under the old
redundant key and the simplified key;
5. benchmark serialization and public reports expose `size_span` consistently.
5. changing the public `rank()` default does not mutate or redefine the stored
canonical structural order.
74 changes: 54 additions & 20 deletions docs/adr/0021-conservative-dominance-preservation-ranking.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ADR 0021 — Conservative dominance-preservation reduction selection

- Status: Experimental
- Status: Accepted for the public ranking default
- Recorded: 2026-09-25
- Does not supersede: ADR 0017 or ADR 0020
- Promoted: 2026-10-01 after the clean/noisy default-policy audit consolidated in #85
- Does not supersede: ADR 0017 structural-order semantics or ADR 0020

## Context

Expand All @@ -22,9 +23,17 @@ A variable-cardinality safe control showed that the metric is deliberately
conservative: it may prefer a larger safe MIS over a smaller safe MIS. This is
acceptable because MISDA prioritizes safe reduction, not maximal reduction.

The later clean/noisy audit established two additional points. First,
`dominance_preservation` is the best-supported optimization-oriented public
default when observed Y is representative. Second, severe corruption of Y can
mislead both dominance geometry and support inferred from the same observations;
this is a data-quality/identifiability boundary rather than a reason to fold
ranking back into discovery.

## Decision

Add an experimental ranking policy named `dominance_preservation`.
The ranking policy `dominance_preservation` is the public default of
`misda.rank(mis_set)`.

For a candidate retained set S, let U be the unordered row pairs for which
neither row dominates the other in full Y. Let N_S be the members of U for
Expand All @@ -41,11 +50,18 @@ an exact tie, larger MISs are ordered first as a conservative operational
tie-break, followed by deterministic objective labels. The tie-break does not
split the scientific group.

The canonical structural order stored by discovery remains `size_span` under
ADR 0017. Making dominance preservation the default of the separate `rank()`
operation does not change discovery, structural dimensions, candidate identity,
or canonical structural ordering.

## Trust annotation does not suppress the answer

MISDA always returns the ranking-selected MIS. It never replaces an
unsupported answer with the full objective set and never stops the analysis.
Instead, `Ranking.assessment` annotates the selected answer with one of:
unsupported answer with the full objective set and never silently filters an
unsupported candidate out of the ranking universe.

`Ranking.assessment` annotates the selected answer with one of:

```text
NO_REDUNDANCY
Expand All @@ -64,23 +80,39 @@ intentional so validation can measure how wrong unsupported answers become.

Support evidence is computed and stored for every discovered MIS using the
shared permutation engine. The historical aggregate `MISSet.support` remains
defined over the canonical first `size_span` group for compatibility.
`MISSet.support_for(candidate)` exposes the stored support of any candidate,
including one selected by an alternative ranking.
defined over the canonical first `size_span` group for compatibility and for
regime-level discovery support. `MISSet.support_for(candidate)` exposes the
stored support of any candidate, including one selected by dominance ranking.

## Evaluation contract

`dominance_preservation` requires stored dominance evidence:
`dominance_preservation` requires dominance evidence for every ranked MIS.
The canonical user flow may therefore use:

```python
mis_set.evaluate(metrics=("dominance",), candidates="all")
ranking = misda.rank(mis_set, policy="dominance_preservation")
ranking = misda.rank(mis_set)
candidate = ranking.mis()
assessment = ranking.assessment
```

Alternatively, `accept_cost=True` may explicitly authorize the missing
dominance evaluation. Ranking and reporting do not silently consult truth.
The default public call authorizes computation of missing dominance evidence as
part of the ranking operation. This is evidence enrichment owned by ranking and
must not alter the discovered MIS universe, graph structure, graph-derived
dimensions, or canonical order.

Callers that need strict control of computation may pre-evaluate evidence or
forbid implicit ranking-time evaluation:

```python
mis_set.evaluate(metrics=("dominance",), candidates="all")
ranking = misda.rank(
mis_set,
policy="dominance_preservation",
accept_cost=False,
)
```

Benchmark truth is never used.

## Interpretation

Expand All @@ -93,14 +125,17 @@ extra objectives is acceptable when that better preserves the observed order.

## Invariants

- `size_span` remains the canonical structural default.
- `dominance_preservation` is the public default of `rank()`.
- `size_span` remains the canonical structural order owned by discovery.
- discovery still enumerates the same complete MIS universe.
- structural and latent dimensions are unchanged by ranking policy.
- benchmark truth never enters runtime selection or trust annotation.
- an unsupported selected MIS is still returned and remains fully inspectable.
- unsupported candidates are not filtered from ranking merely because support
contradicts them.
- `NO_REDUNDANCY` must be possible when no objective reduction is discovered.
- support attached to an alternative selected MIS is candidate-specific rather
than borrowed from the canonical first structural group.
- support attached to a selected MIS is candidate-specific rather than borrowed
from the canonical first structural group.

## Research history

Expand All @@ -109,7 +144,6 @@ SAFE_PATH, Pareto-retention comparison, and the conservative decision probe, are
recorded chronologically in
`docs/research-notes/2026-09-optimization-reduction-safety-and-ranking.md`.

The later pre-default audit that tested this policy across existing clean and
noisy benchmark batteries, and rejected immediate promotion to the public
default, is recorded in
`docs/research-notes/2026-10-ranking-policy-default-audit.md`.
The pre-default audit and the subsequent clean/noisy ranking-policy work are
recorded in the October 2026 research notes and were consolidated before the
public-default decision in #85.
Loading
Loading