diff --git a/org_frontier/classifier/README.md b/org_frontier/classifier/README.md index 8355d354..2929e872 100644 --- a/org_frontier/classifier/README.md +++ b/org_frontier/classifier/README.md @@ -27,19 +27,19 @@ ordinal hint. ## Use -All commands run from the repo root with the IIT-4.0 venv. +All commands run from the repo root with the project venv active (`GETTING_STARTED.md`). ```bash # 1. Validate the instrument on its own controls FIRST (compute, don't assert). -~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.validate +python -m org_frontier.classifier.validate # 2. Classify the built-in library and write results/verdicts.csv. -~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.run +python -m org_frontier.classifier.run # 3. Classify a single form by name, or your own JSON model. -~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.cli --list -~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.cli --form gig_false_dyad -~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.cli --model my_form.json +python -m org_frontier.classifier.cli --list +python -m org_frontier.classifier.cli --form gig_false_dyad +python -m org_frontier.classifier.cli --model my_form.json ``` Or import it: @@ -63,7 +63,8 @@ print(v.competence) # "algorithmacy" ## Status -Scaffolded. Core reuses the dissertation's proven 3-node oracle -(`dissertation/paper2_construct/`) and the repo's exact-Φ oracle (`proxy_audit/exact_phi.py`). -Next: broaden `forms.py` into the coordination-form TPM library (broadcast, market, hierarchy), -and add the proxy bridge so the verdict can be estimated from interaction time-series. +In use as the lab's instrument: every probe and question reads its verdict through `classify_rules`, +and `validate.py` is the `instrument-controls` check CI runs on every pull request. The core wraps the +repo's exact-Φ oracle (`foundations/proxy_audit/exact_phi.py`). The broader form library lives in +[`../corpus/`](../corpus/), and the proxy bridge that estimates the verdict from time series is +[`../proxy_bridge/`](../proxy_bridge/) with the margin cascade in [`../cascade/`](../cascade/). diff --git a/org_frontier/classifier/classifier.py b/org_frontier/classifier/classifier.py index c2a5d146..f6302108 100644 --- a/org_frontier/classifier/classifier.py +++ b/org_frontier/classifier/classifier.py @@ -13,18 +13,18 @@ The test is Φ over the MIP (the least-damaging partition PyPhi finds), NOT Φ over the complete {W}{S}{C} cut. The complete cut over-calls: it severs the genuine two-party coupling a dyad has -and so labels every coupled dyad a triad. See -``dissertation/paper2_construct/party_partition.py`` for the worked demonstration. The MIP is +and so labels every coupled dyad a triad (the worked demonstration is in the private dissertation +repository; the regression forms in ``forms.py`` carry the same contrast). The MIP is itself party-respecting (nodes vs blocks of nodes), so the verdict is about party-line factorization. -This wraps the repo's exact-Φ oracle (``proxy_audit.exact_phi``). It is a structural +This wraps the repo's exact-Φ oracle (``foundations.proxy_audit.exact_phi``). It is a structural CLASSIFIER, validated behaviourally at the binary contrast. It is NOT a graded readability score: the magnitude of Φ depends on the encoding and is not a reliable scale (the dissertation withdrew that claim). Use the binary verdict; read the magnitude as at most an ordinal hint. -Run the built-in validation controls before trusting any verdict: - ~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.validate +Run the built-in validation controls before trusting any verdict (repo root, venv active): + python -m org_frontier.classifier.validate """ import os @@ -32,7 +32,7 @@ from dataclasses import dataclass, field from typing import Callable, Optional, Sequence -# Repo root on the path so the sibling `proxy_audit` package imports. +# Repo root on the path so the `foundations.proxy_audit` package imports. _REPO_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) if _REPO_ROOT not in sys.path: sys.path.insert(0, _REPO_ROOT) @@ -63,7 +63,7 @@ def tpm_from_rules(rules: Sequence[Callable], n: Optional[int] = None) -> np.nda ``rules[j]`` maps the current node-state tuple (little-endian: index 0 = first party) to node j's next value in {0, 1}. Little-endian indexing matches PyPhi and - ``proxy_audit.exact_phi``. + ``foundations.proxy_audit.exact_phi``. """ n = len(rules) if n is None else n tpm = np.zeros((2 ** n, n)) diff --git a/org_frontier/classifier/concepts.md b/org_frontier/classifier/concepts.md index 96155365..a82c30ea 100644 --- a/org_frontier/classifier/concepts.md +++ b/org_frontier/classifier/concepts.md @@ -65,5 +65,5 @@ triadic coordination*. The second can hold while the first stays open. - Theory essay: [`../essays/literacy_or_algorithmacy.md`](../essays/literacy_or_algorithmacy.md) - Survey + gap: [`../landscape/SURVEY_FINDINGS.md`](../landscape/SURVEY_FINDINGS.md) -- Proven oracle: `dissertation/paper2_construct/phi_instrument.py`, `proxy_audit/exact_phi.py` -- Why MIP not complete cut: `dissertation/paper2_construct/party_partition.py` +- Proven oracle: `foundations/proxy_audit/exact_phi.py` (the dissertation's own instrument file is private) +- Why MIP not complete cut: [`methods.md`](methods.md); the public case is `ats_feedback_factors` in `forms.py` diff --git a/org_frontier/classifier/forms.py b/org_frontier/classifier/forms.py index 900ad18e..61497aec 100644 --- a/org_frontier/classifier/forms.py +++ b/org_frontier/classifier/forms.py @@ -3,12 +3,12 @@ Each form is a small application-layer system rendered as per-party Boolean rules (little-endian: index 0 = W, 1 = S, 2 = C). The TPMs are derived from each case's actual coupling — who depends on whom — not chosen for a target Φ. These are the forms validated in -the dissertation's Paper 2 (``dissertation/paper2_construct/worked_examples.py``); they double -as the classifier's demo set and its regression suite (see ``EXPECTED``). +the dissertation's Paper 2 (a private repository; the expected verdicts are fixed here in +``EXPECTED``); they double as the classifier's demo set and its regression suite. Drop in your own form by writing three (or n) rules and calling ``classifier.classify_rules``. -A reusable library of broader forms — broadcast, market, hierarchy — is the next sub-experiment -(see ``../landscape/SURVEY_FINDINGS.md``); stubs are marked TODO below. +A reusable library of broader forms — broadcast, market, hierarchy — lives in ``../corpus/`` +(see ``../landscape/SURVEY_FINDINGS.md``). """ # -------------------------------------------------------------------------------------- diff --git a/org_frontier/classifier/methods.md b/org_frontier/classifier/methods.md index 1906d676..f5cf1742 100644 --- a/org_frontier/classifier/methods.md +++ b/org_frontier/classifier/methods.md @@ -42,8 +42,9 @@ results CSV. the genuine two-party `{W,S}` coupling a dyad has. It therefore over-calls every coupled dyad a triad. The correct binary test is Φ_MIP = 0: a dyad factors along its own least-damaging cut (`{W,S}|{C}`), which the MIP finds; a triad has no such factoring cut. The MIP is itself a -party-respecting partition, so the verdict is still about party-line factorization. Demonstrated in -`dissertation/paper2_construct/party_partition.py`. +party-respecting partition, so the verdict is still about party-line factorization. The worked +demonstration is in the private dissertation repository; `ats_feedback_factors` in `forms.py` is the +public case (triadic wiring, dyadic verdict). ## Controls (run before any verdict) @@ -67,8 +68,8 @@ library), per `../landscape/SURVEY_FINDINGS.md`. ## Reproducibility ```bash -~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.validate # controls -~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.run # library -> CSV +python -m org_frontier.classifier.validate # controls (repo root, venv active) +python -m org_frontier.classifier.run # library -> CSV ``` Built on the same PyPhi IIT-4.0 line as the rest of the repo (`requirements.txt`). diff --git a/org_frontier/classifier/run.py b/org_frontier/classifier/run.py index 3409ba13..0427a077 100644 --- a/org_frontier/classifier/run.py +++ b/org_frontier/classifier/run.py @@ -1,6 +1,6 @@ """Classify the built-in library and write results/verdicts.csv. -Run: ~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.run +Run (from the repo root, venv active): python -m org_frontier.classifier.run """ import csv diff --git a/org_frontier/classifier/validate.py b/org_frontier/classifier/validate.py index b5046599..c4513129 100644 --- a/org_frontier/classifier/validate.py +++ b/org_frontier/classifier/validate.py @@ -8,7 +8,7 @@ 2. IRREDUCIBLE control — a fully coupled 3-node network must classify TRIADIC (Φ > 0). 3. Regression suite — every built-in form matches its EXPECTED structural verdict. -Run: ~/iit-playground/venv-4.0/bin/python -m org_frontier.classifier.validate +Run (from the repo root, venv active): python -m org_frontier.classifier.validate Exit code is non-zero if any control fails. """