Skip to content

Commit eff5ebc

Browse files
committed
Add capability falsification and scientific validity gates
1 parent 957aa1a commit eff5ebc

23 files changed

Lines changed: 1812 additions & 13 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ jobs:
3030
run: rocrate-validator cache warm || true
3131
- name: Test
3232
run: python -m pytest -p no:cacheprovider
33-
- name: Compile retrieval modules
34-
run: python -m compileall -q research_forge/retrieval
33+
- name: Audit capability assurance layers
34+
run: python scripts/audit_capability_assurance.py --root . --execute-replay
35+
- name: Compile retrieval modules
36+
run: python -m compileall -q research_forge/retrieval
3537

3638
frontend:
3739
runs-on: ubuntu-latest

docs/capability-assurance.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Capability assurance
2+
3+
Research Forge separates a product feature list from machine capability claims.
4+
The human catalog has 22 features; the registry has 18 capability IDs. A product
5+
feature may compose several registered capabilities, and several product
6+
features may reuse the same capability. Therefore `22` and `18` are not two
7+
competing scores.
8+
9+
The authoritative mapping is
10+
`research_forge/product_capability_map.yaml`. The assurance command rejects the
11+
mapping unless features 1-22 are consecutive, every referenced capability ID
12+
exists, and the union of mapped IDs is exactly the 18-item registry.
13+
14+
## Three audit layers
15+
16+
```text
17+
registry audit
18+
schema, claim boundary, evidence locators, declared maturity
19+
20+
evidence audit
21+
verified commit, verification time, environment digest, expiry,
22+
source/test drift, positive/negative/mutation coverage
23+
24+
capability replay
25+
rerun the registered positive, negative, and mutation suites
26+
```
27+
28+
Run the first two layers and reuse the latest still-fresh CI replay:
29+
30+
```powershell
31+
python scripts/audit_capability_assurance.py --root .
32+
```
33+
34+
Force a new local replay of every registered falsification suite:
35+
36+
```powershell
37+
python scripts/audit_capability_assurance.py --root . --execute-replay
38+
```
39+
40+
Evidence becomes stale when its expiry passes, a registered source/test/evidence
41+
file changes after the verified commit, a locator disappears, or replay fails.
42+
The command then exits non-zero instead of preserving a green capability label.
43+
44+
## Three independent dimensions
45+
46+
Each capability reports three dimensions rather than combining them into one
47+
ambiguous label:
48+
49+
- **Implementation maturity C0-C4 for release acceptance**: concept,
50+
implementation, component validation, controlled E2E, and real-case
51+
validation.
52+
- **Evidence level E0-E3 for release acceptance**: documented, component
53+
tested, controlled replay, and real-case evidence.
54+
- **Scope**: `component`, `bounded`, `limited_real_case`, or `extension_only`.
55+
56+
For example, controlled clean-room replay is implementation maturity C3,
57+
evidence level E2, scope `limited_real_case`. C5/E4 values remain readable only
58+
for historical-schema compatibility. Research Forge does not require an
59+
external independent researcher, and C5/E4 is not a product gap or release
60+
milestone.
61+
62+
## Product-to-registry mapping
63+
64+
| Product feature | Registered capability ID(s) |
65+
|---|---|
66+
| 1. Four-stage Study workflow | `workflow.control_loop` |
67+
| 2. Project scan and claim discovery | `workflow.control_loop`, `retrieval.gateway` |
68+
| 3. External retrieval | `retrieval.gateway` |
69+
| 4. PaperQA evidence analysis | `retrieval.paperqa_fulltext` |
70+
| 5. Discovery portfolio | `workflow.control_loop`, `retrieval.gateway` |
71+
| 6. Stage 2 contract | `research_contract.compiler` |
72+
| 7. Typed profiles and unsupported routing | `scientific_execution.typed_profiles`, `scientific_completion.cross_domain_autonomy` |
73+
| 8. OpenML hidden-target experiment | `scientific_execution.hidden_target_benchmark` |
74+
| 9. AIRS RAD | `benchmark.official_airs_rad` |
75+
| 10. Existing-project replay | `reproduction.sealed_existing_project_replay` |
76+
| 11. Structural data qualification | `data_quality.great_expectations_gate` |
77+
| 12. Evidence and verdict chain | `scientific_completion.empirical_loop` |
78+
| 13. PROV projection | `interchange.prov_external_validation` |
79+
| 14. Workflow Run RO-Crate | `interchange.rocrate_external_validation` |
80+
| 15. Repair and rollback | `workflow.control_loop`, `research_contract.compiler` |
81+
| 16. Controlled clean-room replay | `reproduction.controlled_clean_room_replay` |
82+
| 17. Public reproduction package | `reproduction.public_minimal_research_package` |
83+
| 18. Evidence-bound paper authoring | `authoring.evidence_bound` |
84+
| 19. SCI/SSCI writing constraints | `authoring.evidence_bound` |
85+
| 20. Nuwa panel | `review.nuwa_panel` |
86+
| 21. Editable scientific diagrams | `visualization.drawio_export` |
87+
| 22. Completion/public replay record | `workflow.control_loop`, `reproduction.public_minimal_research_package` |
88+
89+
## Signature and provenance boundary
90+
91+
Research Forge uses two different objects:
92+
93+
1. A Research Forge Completion Record uses the project-defined schema and
94+
Ed25519 verification. It is not Sigstore or SLSA provenance.
95+
2. A public GitHub-hosted build or replay artifact may carry GitHub artifact
96+
attestation, a Sigstore-issued certificate, and an SLSA provenance predicate.
97+
This proves the artifact's hosted build origin and workflow identity, not an
98+
independent scientific conclusion.
99+
100+
Neither object is described as external independent scientific reproduction.
101+
102+
## Scientific Contribution Gate
103+
104+
The gate is implemented separately from Nuwa review in
105+
`research_forge/scientific_contribution_gate.py`. It checks baseline weakness,
106+
arm identity, mechanism isolation, expected information value, sample adequacy,
107+
novelty, and claim identifiability before contract freeze. Nuwa remains an
108+
advisory same-model review panel and cannot override the deterministic gate.
109+
110+
## Evaluator-family robustness
111+
112+
When a contract uses a learned evaluator, Contract Compiler v2 requires a
113+
second, genuinely distinct evaluator family plus a frozen disagreement policy.
114+
Stage 3 stores append-only family results and reports aggregate metric
115+
agreement, row-level disagreement, directional agreement, and verdict
116+
stability. An unstable or unadjudicated comparison blocks formal completion;
117+
it never rewrites either evaluator's historical output.

docs/profile-capability-matrix.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Profile capability matrix
2+
3+
Research Forge distinguishes four things that were previously mixed together:
4+
5+
1. A **formal Profile Bundle** owns a frozen contract schema, run-plan compiler,
6+
builder, evaluator, statistical adjudicator, repair policy, and assurance
7+
suite. Only `certified` and `legacy_frozen` bundles may enter formal Stage 3.
8+
2. A **task mode** is a bounded behavior inside a Profile, such as fixed-split
9+
numeric classification inside `tabular_ml_v1`.
10+
3. A **domain adapter** adds semantic validation or defaults but does not supply
11+
a complete runner. `finance_backtest` is currently such an adapter.
12+
4. A **fixture or non-formal extension** may support feasibility or component
13+
testing but cannot produce a formal scientific Verdict.
14+
15+
The machine-readable source is
16+
`research_forge/profile_capability_matrix.yaml`; CI checks it against the
17+
`Stage3Profile` enum and the live Profile Bundle registry.
18+
19+
| Profile | Registry state | Formal Stage 3 | Supported mode / boundary |
20+
|---|---|---:|---|
21+
| `tabular_ml_v1` | certified | yes | Numeric CSV classification/regression; formal fixed split |
22+
| `benchmark_prediction_v1` | certified | yes | Candidate submission isolated from hidden targets |
23+
| `existing_python_project_v1` | certified | yes | Explicit two-arm command replay; not automatic domain semantics |
24+
| `computational_paired_comparison_v1` | legacy frozen | yes | Compatibility-only paired continuous semantics |
25+
| `computational_paired_comparison_v2` | certified | yes | Cluster-aware paired continuous analysis |
26+
| `paired_binary_independent_v1` | certified | yes | Independent paired binary units |
27+
| `paired_binary_clustered_v1` | certified | yes | Clustered paired binary units |
28+
| `paired_multi_arm_ablation_v1` | certified | yes | Three-or-more-arm paired ablation |
29+
| `deterministic_simulation_v1` | development | no | Component fixture only |
30+
| `paired_multi_endpoint_v1` | unregistered | no | Reserved enum; no bundle/runner |
31+
| `unpaired_two_group_continuous_v1` | unregistered | no | Reserved enum; no bundle/runner |
32+
33+
Finance, retrieval, survey, and other domain labels are not silently promoted
34+
to formal Profiles. Unsupported designs fail closed or return a design/build
35+
route; they never inherit maturity from `existing_python_project_v1` merely
36+
because Python can execute them.

0 commit comments

Comments
 (0)