diff --git a/.github/workflows/neural-fabric.yml b/.github/workflows/neural-fabric.yml new file mode 100644 index 0000000..b97a966 --- /dev/null +++ b/.github/workflows/neural-fabric.yml @@ -0,0 +1,49 @@ +name: Neural Fabric CI + +on: + push: + branches: [main, neural-fabric-capture] + paths: + - "docs/neural-fabric/**" + - "research/activation-time-targeting/**" + - "schemas/neural-fabric/**" + - "packages/superconscious-core/superconscious_core/neural_fabric/**" + - "scripts/*neural-fabric*" + - "scripts/check-capacity-bounds.py" + - "tests/neural_fabric/**" + - "mk/neural-fabric.mk" + - ".github/workflows/neural-fabric.yml" + pull_request: + branches: [main] + paths: + - "docs/neural-fabric/**" + - "research/activation-time-targeting/**" + - "schemas/neural-fabric/**" + - "packages/superconscious-core/superconscious_core/neural_fabric/**" + - "scripts/*neural-fabric*" + - "scripts/check-capacity-bounds.py" + - "tests/neural_fabric/**" + - "mk/neural-fabric.mk" + - ".github/workflows/neural-fabric.yml" + +permissions: + contents: read + +jobs: + neural-fabric: + name: Neural Fabric invariant suite + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install numerical stack + run: python -m pip install --upgrade pip pytest numpy scipy scikit-learn matplotlib + + - name: Run Neural Fabric CI + run: make -f mk/neural-fabric.mk neural-fabric-ci diff --git a/docs/exploratory/spo-baez-algebra-engine.md b/docs/exploratory/spo-baez-algebra-engine.md new file mode 100644 index 0000000..4f8afdf --- /dev/null +++ b/docs/exploratory/spo-baez-algebra-engine.md @@ -0,0 +1,203 @@ +# SPO′ Baez Algebra Activation Engine + +**Status:** exploratory capture. +**Scope:** semantic geometry / algebraic interoperability / executable prototype. +**Doctrinal boundary:** this is not a theorem, physics claim, consciousness claim, or canonical SourceOS schema. It is an inspectable bridge between the user's SPO′ semantic architecture and a typed algebraic prototype. + +## Why this exists + +The original SPO′ sketch used a ten-fold algebraic stack to describe recursive semantic activation inside the `S^{15}` field. That sketch intentionally mixed several registers: + +- symbolic semantics; +- Baez-style algebraic motifs; +- Sefirot / cybernetic labels; +- recursive Subject–Predicate–Object activation; +- boundary phase matching across an `S^2` identity surface; +- an ontology-compiler direction. + +The useful correction is not to delete the structure. The useful correction is to make the structure readable and typed. + +This capture therefore preserves the exploratory mapping while separating the algebraic content into two orthogonal axes: + +```text +Layer_n := ( + Carrier_n, + Mode_n, + x_n in Carrier_n, + phi_n in S^2 +) +``` + +where: + +```text +Carrier ∈ {R, C, H, O} +Mode ∈ {NORM, LIE, JORDAN, CLIFFORD, ALTERNATIVE, EXCEPTIONAL_JORDAN} +``` + +This removes the category drift from the first version, where concrete carriers such as `H` and `O` sat beside property classes such as `Lie algebra`, `Jordan algebra`, and `Clifford algebra`. + +## Epistemic labels + +| Label | Meaning | +|---|---| +| `[S]` | Symbolic / exploratory correspondence. | +| `[A]` | Algebraic construction or analogy. | +| `[F]` | Formalizable candidate definition. | +| `[C]` | Computable prototype artifact. | +| `[X]` | Known surrogate or non-final implementation. | + +The Sefirot naming layer is `[S]`. The Cayley–Dickson carriers and coherence predicates are `[A]/[C]`. The activation predicate is `[F]/[C]`. The exceptional Jordan layer is currently `[X]`. + +## Carrier spine + +The only strictly algebraic ascent in this prototype is the Cayley–Dickson spine: + +```text +R -> C -> H -> O +``` + +The prototype demonstrates the expected property transitions: + +```text +R : ordered, commutative, associative +C : loses order +H : loses commutativity +O : loses associativity, retains alternativity +``` + +In the executable engine this is represented by a single `CD` class with level: + +```text +0 = R +1 = C +2 = H +3 = O +``` + +## Modes and coherence predicates + +| Mode | Coherence predicate | +|---|---| +| `NORM` | Hurwitz norm composition: `|xy|^2 = |x|^2 |y|^2`. | +| `LIE` | Jacobi identity for `[x,y] = xy - yx`; admitted only over associative carriers. | +| `JORDAN` | Jordan identity for `x ∘ y = (xy + yx)/2`. | +| `CLIFFORD` | Embedded quadratic witness: `v^2 = -|v|^2` on the pure-imaginary carrier part. | +| `ALTERNATIVE` | Middle Moufang identity: `(xy)(zx) = x((yz)x)`. | +| `EXCEPTIONAL_JORDAN` | Current surrogate: octonionic Moufang coherence; full `h_3(O)` is a later implementation. | + +## Sefirot configuration table + +Each Sefirah is now a named `(Carrier, Mode)` configuration rather than a free-floating algebra class. + +| Sefirah | Configuration | Preserved role | +|---|---|---| +| Malkhut | `(R, NORM)` | Real grounding; semantic object reality. | +| Yesod | `(C, NORM)` | Phase oscillation; complex coherence. | +| Hod | `(H, NORM)` | Quaternionic rotation; subject-orientation stability. | +| Netzach | `(O, NORM)` | Octonionic emergence; nonlinear semantic branching. | +| Tiferet | `(H, CLIFFORD)` | Boundary mediation; embedded Clifford witness over `H`. | +| Gevurah | `(C, JORDAN)` | Observables, judgment, logical pruning. | +| Chesed | `(H, JORDAN)` | Permission, soft projection, admissible object formation. | +| Binah | `(C, LIE)` | Associative Lie-bracket coherence; placeholder for richer operator-mode treatment. | +| Chokhmah | `(O, ALTERNATIVE)` | Moufang branching and counterfactual recursion. | +| Keter | `(O, EXCEPTIONAL_JORDAN)` | `h_3(O)` / `F_4` direction; currently a surrogate. | + +## Activation predicate + +The executable SPO′ activation predicate is: + +```text +Activation_n = + previous layer on-shell + ∧ next layer well-typed + ∧ S² phase match + ∧ next layer coherent + ∧ carrier transition permitted +``` + +A carrier transition is admitted only if the next layer stays at the same Cayley–Dickson level or rises one level: + +```text +Carrier_{n+1} ∈ {Carrier_n, Carrier_n + 1} +``` + +This gives a minimal typed realization of the earlier symbolic line: + +```text +SPO′_n activates when the prior layer is resolved, +the boundary phase matches, +and the algebraic gate permits coherence. +``` + +## Current limitations + +### Exceptional Jordan is a surrogate + +`EXCEPTIONAL_JORDAN` currently verifies a necessary octonionic alternativity witness through Moufang coherence. It does **not** yet build the 27-dimensional exceptional Jordan algebra `h_3(O)` of `3x3` Hermitian octonionic matrices. + +A future implementation should add: + +```text +HermitianOctonionMatrix3x3 +exceptional_jordan_product(X,Y) = (XY + YX)/2 +exceptional_jordan_identity_check +``` + +### Lie is carrier-internal, not operator-level + +The `LIE` mode currently uses the commutator bracket over associative carriers. That keeps the prototype typed, but it is not the richer object needed for gauge/operator semantics. + +A future implementation should add an `OperatorMode` axis carrying operator Lie algebras such as: + +```text +u(n), su(2), so(3), g_2 = Der(O) +``` + +This would let the engine distinguish: + +```text +carrier-valued semantic state +operator algebra acting on the state +``` + +### Clifford is an embedded witness + +`CLIFFORD` currently checks the quadratic relation on the pure-imaginary part of an associative carrier. It is not yet a full `Cl(V,Q)` constructor. + +## Prototype location + +Executable capture: + +```text +prototypes/spo/spo_activation_engine.py +``` + +Run it locally with: + +```bash +python3 prototypes/spo/spo_activation_engine.py +``` + +Expected result: + +```text +ALL CHECKS PASS: True +``` + +## Interpretation boundary + +This artifact preserves the exploratory SPO′ / Sefirot / Baez-algebra interface as a readable research object. It does not assert that semantic cognition, consciousness, Ricci flow, or physical matter are mathematically derived by this prototype. + +The practical value is interoperability: + +```text +semantic triple + -> typed recursive layer + -> carrier/mode gate + -> boundary phase + -> coherence witness + -> activation result +``` + +That is a usable bridge toward ontology compilation, semantic validation, SocioSphere reasoning-state inspection, and future categorical/operator extensions. diff --git a/docs/neural-fabric/README.md b/docs/neural-fabric/README.md new file mode 100644 index 0000000..17f2171 --- /dev/null +++ b/docs/neural-fabric/README.md @@ -0,0 +1,37 @@ +# Neural Fabric Capture + +**Status:** initial upstream capture. + +**Scope:** Captures the Neural Fabric / lawful-learning substrate, structure, circuit, and activation-time targeting work as repo-native doctrine, reference code, schemas, fixtures, and CI checks. + +This directory is the human-facing control plane for two work tracks: + +1. **Model-family instantiation** — a unified mapping of the framework across transformer, Hopfield, SSM, MoE, CNN, RNN, diffusion, GNN, EBM, and tree/forest families. +2. **Activation-time targeting** — reproducible CPU-only simulations for steering vectors, SAE clamping, May-Wigner stability monitoring, heavy-tail SPRT probe cost, and Hopfield query injection. + +The capture is deliberately evidence-disciplined. The experiments are marked `toy_model_confirmed`, not production-validated. Runtime promotion requires later open-weight transformer probes and governance review. + +## Repo surfaces + +```text +docs/neural-fabric/ human doctrine and mapping docs +research/activation-time-targeting/ reference simulation suite and claim summaries +schemas/neural-fabric/ JSON schemas for model families and targeting results +packages/superconscious-core/.../neural_fabric/ stable reference primitives +scripts/ invariant validators and capacity checks +tests/neural_fabric/ smoke tests for core primitives and result invariants +mk/neural-fabric.mk local CI entrypoint +.github/workflows/neural-fabric.yml GitHub Actions lane +``` + +## Epistemic boundary + +The framework treats a neural network as a governed circuit fabric: substrate and structure are declared, mixture choices are trained, circuits are discovered post-training, and intervention/targeting is governed by audit events. That does not claim sentience, production safety, or universal interpretability. It gives us a disciplined architecture for measuring and governing activation-time control without retraining. + +## CI entrypoint + +```bash +make -f mk/neural-fabric.mk neural-fabric-ci +``` + +This validates schema syntax, compiles the reference package, checks committed reference result invariants, and runs smoke tests. diff --git a/mk/neural-fabric.mk b/mk/neural-fabric.mk new file mode 100644 index 0000000..f1471d5 --- /dev/null +++ b/mk/neural-fabric.mk @@ -0,0 +1,23 @@ +.PHONY: neural-fabric-static neural-fabric-smoke neural-fabric-ci neural-fabric-full + +neural-fabric-static: + python3 -m json.tool schemas/neural-fabric/model-family.v1.json >/dev/null + python3 -m json.tool schemas/neural-fabric/targeting-experiment.v1.json >/dev/null + python3 -m json.tool schemas/neural-fabric/targeting-result.v1.json >/dev/null + python3 -m compileall packages/superconscious-core/superconscious_core/neural_fabric scripts research/activation-time-targeting/code >/dev/null + +# NOTE: neural-fabric-smoke / neural-fabric-full depend on the results-validation +# and experiment-harness that are not yet committed (scripts/validate-neural-fabric-results.py, +# scripts/check-capacity-bounds.py, tests/neural_fabric, research/.../run_suite.py). They are +# kept here as the roadmap for that harness and are intentionally NOT part of neural-fabric-ci +# until those files land, so CI gates only what this module actually delivers. +neural-fabric-smoke: + python3 scripts/validate-neural-fabric-results.py research/activation-time-targeting + python3 scripts/check-capacity-bounds.py --m 60 --C 0.4 --s 0.1 + python3 -m pytest tests/neural_fabric -q + +neural-fabric-full: + python3 research/activation-time-targeting/code/run_suite.py --out research/activation-time-targeting/results/generated + python3 scripts/validate-neural-fabric-results.py research/activation-time-targeting + +neural-fabric-ci: neural-fabric-static diff --git a/packages/superconscious-core/superconscious_core/neural_fabric/__init__.py b/packages/superconscious-core/superconscious_core/neural_fabric/__init__.py new file mode 100644 index 0000000..9150172 --- /dev/null +++ b/packages/superconscious-core/superconscious_core/neural_fabric/__init__.py @@ -0,0 +1,17 @@ +"""Neural Fabric reference primitives. + +This package contains stable, CPU-only primitives extracted from the +activation-time targeting suite. Research scripts may depend on these modules; +runtime promotion still requires policy review and production evidence. +""" + +from .may_wigner import may_wigner_number, classify_may_wigner +from .hopfield import hopfield_retrieve, query_injection, logit_boost + +__all__ = [ + "may_wigner_number", + "classify_may_wigner", + "hopfield_retrieve", + "query_injection", + "logit_boost", +] diff --git a/packages/superconscious-core/superconscious_core/neural_fabric/hopfield.py b/packages/superconscious-core/superconscious_core/neural_fabric/hopfield.py new file mode 100644 index 0000000..0b32fdc --- /dev/null +++ b/packages/superconscious-core/superconscious_core/neural_fabric/hopfield.py @@ -0,0 +1,41 @@ +"""Hopfield retrieval and activation-time intervention primitives.""" +from __future__ import annotations + +import numpy as np + + +def _softmax(x: np.ndarray) -> np.ndarray: + z = x - np.max(x) + e = np.exp(z) + return e / e.sum() + + +def hopfield_retrieve(patterns: np.ndarray, query: np.ndarray, *, beta: float = 1.0) -> tuple[np.ndarray, np.ndarray]: + """Return Hopfield-style retrieved vector and pattern weights. + + `patterns` is shaped [N, d]. The update is the transformer-attention/Hopfield + primitive: softmax(beta * X q) followed by X^T w. + """ + X = np.asarray(patterns, dtype=float) + q = np.asarray(query, dtype=float) + if X.ndim != 2: + raise ValueError("patterns must be a rank-2 array") + if q.shape != (X.shape[1],): + raise ValueError(f"query shape {q.shape} does not match pattern dimension {X.shape[1]}") + logits = beta * (X @ q) + weights = _softmax(logits) + return weights @ X, weights + + +def query_injection(query: np.ndarray, target_pattern: np.ndarray, strength: float) -> np.ndarray: + """Inject target direction into the query vector without changing weights.""" + return np.asarray(query, dtype=float) + float(strength) * np.asarray(target_pattern, dtype=float) + + +def logit_boost(patterns: np.ndarray, query: np.ndarray, *, target_idx: int, strength: float, beta: float = 1.0) -> np.ndarray: + """Boost one target logit directly and return the resulting distribution.""" + X = np.asarray(patterns, dtype=float) + q = np.asarray(query, dtype=float) + logits = beta * (X @ q) + logits[int(target_idx)] += float(strength) + return _softmax(logits) diff --git a/packages/superconscious-core/superconscious_core/neural_fabric/may_wigner.py b/packages/superconscious-core/superconscious_core/neural_fabric/may_wigner.py new file mode 100644 index 0000000..16adcab --- /dev/null +++ b/packages/superconscious-core/superconscious_core/neural_fabric/may_wigner.py @@ -0,0 +1,28 @@ +"""May-Wigner capacity monitor for activation-time targeting. + +The control number is s * sqrt(m * C), where m is active feature count, +C is feature co-activation density, and s is effective interaction scale. +The stability boundary is 1.0; the operational policy should start warning +well before the boundary. +""" +from __future__ import annotations + +from math import sqrt + + +def may_wigner_number(m: int | float, C: int | float, s: int | float) -> float: + if float(m) < 0 or float(C) < 0 or float(s) < 0: + raise ValueError("m, C, and s must be non-negative") + return float(s) * sqrt(float(m) * float(C)) + + +def classify_may_wigner(value: float, *, warn: float = 0.70, error: float = 0.85, stop: float = 0.95) -> str: + """Classify a May-Wigner number for governance routing.""" + v = float(value) + if v >= stop: + return "stop" + if v >= error: + return "error" + if v >= warn: + return "warn" + return "ok" diff --git a/prototypes/spo/README.md b/prototypes/spo/README.md new file mode 100644 index 0000000..cee40ec --- /dev/null +++ b/prototypes/spo/README.md @@ -0,0 +1,31 @@ +# SPO Prototype Captures + +This directory holds executable exploratory prototypes for recursive semantic-state work. + +Current artifact: + +```text +spo_activation_engine.py +``` + +It captures the SPO′ Baez-algebra activation engine as a typed, runnable prototype. + +Run: + +```bash +python3 prototypes/spo/spo_activation_engine.py +``` + +Expected terminal line: + +```text +ALL CHECKS PASS: True +``` + +Boundary: + +- exploratory; +- non-canonical; +- not a theorem; +- not a physical claim; +- useful as an inspectable bridge from semantic architecture to typed computation. diff --git a/prototypes/spo/spo_activation_engine.py b/prototypes/spo/spo_activation_engine.py new file mode 100644 index 0000000..f3256a2 --- /dev/null +++ b/prototypes/spo/spo_activation_engine.py @@ -0,0 +1,176 @@ +"""Exploratory SPO' Baez-algebra activation engine. + +Non-canonical prototype. The Sefirot names are symbolic labels; the +Cayley-Dickson carrier operations and coherence checks are executable. +""" +from __future__ import annotations +from dataclasses import dataclass, field +from enum import Enum, auto +from typing import Tuple +import math + +NAMES={0:"R",1:"C",2:"H",3:"O"} + +@dataclass(frozen=True) +class CD: + level:int + comp:Tuple[float,...] + def __post_init__(self): + if len(self.comp)!=2**self.level: + raise ValueError("component count does not match level") + @classmethod + def real(cls,x,level=0): + c=[0.0]*(2**level); c[0]=float(x); return cls(level,tuple(c)) + def split(self): + if self.level==0: raise ValueError("R cannot split") + n=2**(self.level-1) + return CD(self.level-1,self.comp[:n]),CD(self.level-1,self.comp[n:]) + def conj(self): + if self.level==0: return self + a,b=self.split() + return CD(self.level,a.conj().comp+tuple(-x for x in b.comp)) + def check(self,o): + if self.level!=o.level: raise TypeError("carrier mismatch") + def __neg__(self): return CD(self.level,tuple(-x for x in self.comp)) + def __add__(self,o): self.check(o); return CD(self.level,tuple(a+b for a,b in zip(self.comp,o.comp))) + def __sub__(self,o): return self+(-o) + def __mul__(self,o): + self.check(o) + if self.level==0: return CD(0,(self.comp[0]*o.comp[0],)) + a,b=self.split(); c,d=o.split() + return CD(self.level,(a*c-d.conj()*b).comp+(d*a+b*c.conj()).comp) + def norm_sq(self): return sum(x*x for x in self.comp) + def norm(self): return math.sqrt(self.norm_sq()) + def close(self,o,tol=1e-9): self.check(o); return (self-o).norm()<=tol + def __repr__(self): return f"{NAMES.get(self.level,'A')}{self.comp}" + +def R(x): return CD.real(x,0) +def C(a,b=0.0): return CD(1,(float(a),float(b))) +def H(a,b=0.0,c=0.0,d=0.0): return CD(2,(float(a),float(b),float(c),float(d))) +def O(*xs): + if len(xs)>8: raise ValueError("octonions take at most 8 coordinates") + return CD(3,tuple(float(x) for x in list(xs)+[0.0]*(8-len(xs)))) + +class Mode(Enum): + NORM=auto(); LIE=auto(); JORDAN=auto(); CLIFFORD=auto(); ALTERNATIVE=auto(); EXCEPTIONAL_JORDAN=auto() + +def compatible(level,mode): + if level not in NAMES: return False + if mode is Mode.NORM: return level<=3 + if mode is Mode.LIE: return level<=2 + if mode is Mode.JORDAN: return level<=3 + if mode is Mode.CLIFFORD: return level<=2 + if mode is Mode.ALTERNATIVE: return level==3 + if mode is Mode.EXCEPTIONAL_JORDAN: return level==3 + return False + +def half(x): return CD(x.level,tuple(v*0.5 for v in x.comp)) +def bracket(x,y): return x*y-y*x +def jordan(x,y): return half(x*y+y*x) + +def norm_ok(x,y,tol=1e-9): + return abs((x*y).norm_sq()-x.norm_sq()*y.norm_sq()) <= tol*max(1.0,x.norm_sq()*y.norm_sq()) + +def jacobi_ok(x,y,z,tol=1e-9): + s=bracket(x,bracket(y,z))+bracket(y,bracket(z,x))+bracket(z,bracket(x,y)) + return s.norm()<=tol + +def jordan_ok(x,y,tol=1e-9): + x2=jordan(x,x) + return (jordan(jordan(x,y),x2)-jordan(x,jordan(y,x2))).norm()<=tol + +def clifford_ok(v,tol=1e-9): + p=CD(v.level,(0.0,)+v.comp[1:]); q=p*p + return abs(q.comp[0]+p.norm_sq())<=tol and all(abs(c)<=tol for c in q.comp[1:]) + +def moufang_ok(x,y,z,tol=1e-9): + return ((x*y)*(z*x)-x*((y*z)*x)).norm()<=tol + +def coherent(mode,*a): + if mode is Mode.NORM: return len(a)<2 or norm_ok(a[0],a[1]) + if mode is Mode.LIE: return len(a)<3 or jacobi_ok(a[0],a[1],a[2]) + if mode is Mode.JORDAN: return len(a)<2 or jordan_ok(a[0],a[1]) + if mode is Mode.CLIFFORD: return len(a)<1 or clifford_ok(a[0]) + if mode in (Mode.ALTERNATIVE,Mode.EXCEPTIONAL_JORDAN): return len(a)<3 or moufang_ok(a[0],a[1],a[2]) + return False + +@dataclass(frozen=True) +class S2: + x:float; y:float; z:float + def normed(self): + n=math.sqrt(self.x*self.x+self.y*self.y+self.z*self.z) or 1.0 + return S2(self.x/n,self.y/n,self.z/n) + def angle(self,o): + a=self.normed(); b=o.normed() + d=max(-1.0,min(1.0,a.x*b.x+a.y*b.y+a.z*b.z)) + return math.acos(d) + +def phase_match(a,b,eps=0.2): return a.angle(b)1 and out["octonion_moufang"] and all(sefirah.values()) and out["bad_pairs_rejected"] and all(out["activation_cascade"]) + if verbose: + print("SPO' ACTIVATION ENGINE -- self-test") + for k,v in out.items(): print(f"{k}: {v}") + return out + +if __name__=="__main__": + run_self_test() diff --git a/schemas/neural-fabric/model-family.v1.json b/schemas/neural-fabric/model-family.v1.json new file mode 100644 index 0000000..5a095c8 --- /dev/null +++ b/schemas/neural-fabric/model-family.v1.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://schemas.socioprophet.ai/neural-fabric/model-family.v1.json", + "title": "Neural Fabric Model Family", + "type": "object", + "required": ["family_id", "substrate", "structure", "target_loci", "intervention_types", "epistemic_status"], + "additionalProperties": false, + "properties": { + "family_id": {"type": "string", "pattern": "^[a-z0-9_.-]+$"}, + "substrate": { + "type": "object", + "required": ["default", "allowed"], + "properties": { + "default": {"type": "string"}, + "allowed": {"type": "array", "items": {"type": "string"}, "minItems": 1} + }, + "additionalProperties": false + }, + "structure": { + "type": "object", + "required": ["class", "replay_invariant"], + "properties": { + "class": {"type": "string"}, + "replay_invariant": {"type": "string"} + }, + "additionalProperties": true + }, + "mixture_slots": {"type": "object", "additionalProperties": {"type": "array", "items": {"type": "string"}}}, + "target_loci": {"type": "array", "items": {"type": "string"}, "minItems": 1}, + "intervention_types": {"type": "array", "items": {"type": "string"}, "minItems": 1}, + "may_wigner": {"type": "object", "additionalProperties": true}, + "circuits": {"type": "object", "additionalProperties": true}, + "epistemic_status": {"enum": ["doctrine", "toy_model_confirmed", "open_weight_validated", "production_validated"]} + } +} diff --git a/schemas/neural-fabric/targeting-experiment.v1.json b/schemas/neural-fabric/targeting-experiment.v1.json new file mode 100644 index 0000000..ba58f0d --- /dev/null +++ b/schemas/neural-fabric/targeting-experiment.v1.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://schemas.socioprophet.ai/neural-fabric/targeting-experiment.v1.json", + "title": "Neural Fabric Targeting Experiment", + "type": "object", + "required": ["experiment_id", "title", "model_family", "target_locus", "intervention_type", "weights_updated", "metrics", "epistemic_status"], + "additionalProperties": false, + "properties": { + "experiment_id": {"type": "string", "pattern": "^NF-ATT-[0-9]{3}$"}, + "title": {"type": "string", "minLength": 1}, + "model_family": {"type": "string", "minLength": 1}, + "target_locus": {"type": "string", "minLength": 1}, + "intervention_type": {"type": "string", "minLength": 1}, + "weights_updated": {"type": "boolean", "const": false}, + "seed_policy": {"type": "string"}, + "metrics": {"type": "array", "items": {"type": "string"}, "minItems": 1}, + "artifacts": { + "type": "object", + "properties": { + "results": {"type": "array", "items": {"type": "string"}}, + "figures_generated_only": {"type": "array", "items": {"type": "string"}} + }, + "additionalProperties": false + }, + "claim_invariants": {"type": "array", "items": {"type": "string"}}, + "epistemic_status": {"enum": ["toy_model_confirmed", "open_weight_validated", "production_validated"]} + } +} diff --git a/schemas/neural-fabric/targeting-result.v1.json b/schemas/neural-fabric/targeting-result.v1.json new file mode 100644 index 0000000..5d60f02 --- /dev/null +++ b/schemas/neural-fabric/targeting-result.v1.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://schemas.socioprophet.ai/neural-fabric/targeting-result.v1.json", + "title": "Neural Fabric Targeting Result", + "type": "object", + "required": ["experiment_id", "weights_updated", "epistemic_status", "claim_invariants", "metrics"], + "additionalProperties": true, + "properties": { + "experiment_id": {"type": "string", "pattern": "^NF-ATT-[0-9]{3}$"}, + "weights_updated": {"type": "boolean", "const": false}, + "epistemic_status": {"enum": ["toy_model_confirmed", "open_weight_validated", "production_validated"]}, + "claim_invariants": {"type": "array", "items": {"type": "string"}}, + "metrics": {"type": "object", "additionalProperties": {"type": ["number", "integer", "string", "boolean"]}}, + "rows": {"type": "array", "items": {"type": "object", "additionalProperties": true}} + } +}