mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-08-01 16:40:24 +00:00
Scaffold ETR (Drive-Box Driver 4) invariants-first in GNU Octave
Rebuild ETR as a single point on three independent toroidal axes, per the restart discipline (laws -> tests -> fit constants). All prior ETR numbers (R port and the CC-BY PDFs) are disowned; nothing carried forward. - src/endocrine/etr/etr_invariants.md: ETR laws (+/-50 wrap, per-axis [17,35] bands, opposition direction, AI-originated drift) with certainty tags, plus the cross-organ drift/stress provenance (SAE -> EthInt convictions -> stress endomotiv -> reshuffle / shift-rate) captured as open seams. - src/endocrine/etr/etr.m: wrap + restoring direction implemented (law); restoring magnitude (RESTORE_GAIN) and cross-axis coupling left as explicit TBD stubs, not invented. - src/endocrine/etr/test_etr.m + run_etr_tests.sh: red tests encoding the laws. 12 pass (confirmed laws), 2 fail honestly (unfitted magnitude + convergence), 2 pending (unconfirmed coupling / no-zero-crossing). Language: GNU Octave (GPL/copyleft, lightweight, native torus mod-wrap). Ada rejected for ETR (proves discrete invariants; ETR is continuous torus dynamics). Rest of the Drive-Box stays R. https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c
This commit is contained in:
parent
ed90ccf36a
commit
a3f2b3ddb2
98
src/endocrine/etr/etr.m
Normal file
98
src/endocrine/etr/etr.m
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
1; % script-file marker: makes every function below visible when this file is sourced.
|
||||||
|
% =====================================================================
|
||||||
|
% ETR — Existential Temporality Relief · Drive-Box Driver 4 · SCAFFOLD
|
||||||
|
% =====================================================================
|
||||||
|
% Model: a SINGLE POINT on three INDEPENDENT toroidal axes (x, y, z) —
|
||||||
|
% not vectors, not a field. See etr_invariants.md for the laws + tags.
|
||||||
|
%
|
||||||
|
% L1 wrap : each axis toroidal, wraps at +/-50 (period 100) [C5]
|
||||||
|
% L2 bands : stable when 17 <= |v| <= 35 (v in [-35,-17] U [17,35]) [C5]
|
||||||
|
% L3 oppose : |v|<17 push OUTWARD (off 0); |v|>35 push INWARD (off edge)[C5]
|
||||||
|
% L4 drift : per-step motion is AI-originated, fed by the caller [C4]
|
||||||
|
% L5 couple : axes couple via a stress metric — MAPPING UNDEFINED [C1]
|
||||||
|
%
|
||||||
|
% SCAFFOLD discipline: wrap + restoring DIRECTION are implemented (they
|
||||||
|
% are law, no fitting). The restoring MAGNITUDE (RESTORE_GAIN) and the
|
||||||
|
% cross-axis COUPLING are deliberately UNIMPLEMENTED stubs so their tests
|
||||||
|
% stay RED until fitted. No disowned number is carried forward.
|
||||||
|
% =====================================================================
|
||||||
|
|
||||||
|
% ---- law constants (these ARE the law, not fitted) ----
|
||||||
|
function v = ETR_BAND_LO(); v = 17; endfunction
|
||||||
|
function v = ETR_BAND_HI(); v = 35; endfunction
|
||||||
|
function v = ETR_WRAP(); v = 50; endfunction
|
||||||
|
|
||||||
|
% ---- state: one point, three scalars ----
|
||||||
|
function s = etr_init(coord)
|
||||||
|
if nargin < 1, coord = [25 25 25]; endif % default: a valid in-band point
|
||||||
|
s = struct('coord', coord(:)');
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
% ---- L1: per-axis toroidal wrap (CONFIRMED, implemented) ----
|
||||||
|
% Maps any real onto the half-open torus [-50, 50); +50 is identified with -50.
|
||||||
|
function w = etr_axis_wrap(v)
|
||||||
|
P = 2 * ETR_WRAP(); % period = 100
|
||||||
|
w = mod(v + ETR_WRAP(), P) - ETR_WRAP(); % -> [-50, 50)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
% ---- L3: per-axis restoring DIRECTION (CONFIRMED law, implemented) ----
|
||||||
|
% |v| < LO -> +sign(v) (outward, off 0)
|
||||||
|
% |v| > HI -> -sign(v) (inward, off the edge)
|
||||||
|
% in band -> 0 (slack)
|
||||||
|
function d = etr_axis_restoring_dir(v)
|
||||||
|
a = abs(v);
|
||||||
|
if a < ETR_BAND_LO()
|
||||||
|
d = sign(v);
|
||||||
|
elseif a > ETR_BAND_HI()
|
||||||
|
d = -sign(v);
|
||||||
|
else
|
||||||
|
d = 0;
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
% ---- L3: per-axis restoring FORCE (STUB: magnitude UNFITTED -> RED) ----
|
||||||
|
% Direction above is law; the magnitude/curve (RESTORE_GAIN) is C1 TBD.
|
||||||
|
% Returns 0 for now so the magnitude + convergence tests stay red.
|
||||||
|
function r = etr_axis_restoring(v)
|
||||||
|
r = 0; % STUB — TODO: RESTORE_GAIN * shape(v) along etr_axis_restoring_dir(v)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
% ---- L5: cross-axis coupling (OPEN SEAM) ----
|
||||||
|
% The three axes couple via a stress metric (hypothesis: PS+/Eth-Int load).
|
||||||
|
% Mapping UNDEFINED [C1] -> identity while stress-coupling is undefined.
|
||||||
|
function c = etr_coupling(coord, stress)
|
||||||
|
c = coord; % STUB — TODO: define the stress-mediated cross-axis mapping
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
% ---- one ETR step: AI drift -> coupling -> per-axis restoring -> wrap ----
|
||||||
|
% drift : 1x3, caller-supplied AI-originated motion (L4 — NOT generated here)
|
||||||
|
% stress : scalar coupling mediator (0 = off)
|
||||||
|
function s = etr_step(s, drift, stress)
|
||||||
|
if nargin < 2
|
||||||
|
error('etr_step: AI-originated drift must be supplied (L4 — ETR does not invent motion)');
|
||||||
|
endif
|
||||||
|
if nargin < 3, stress = 0; endif
|
||||||
|
c = etr_coupling(s.coord, stress);
|
||||||
|
for i = 1:3
|
||||||
|
c(i) = c(i) + drift(i) + etr_axis_restoring(c(i));
|
||||||
|
c(i) = etr_axis_wrap(c(i));
|
||||||
|
endfor
|
||||||
|
s.coord = c;
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
% ---- per-axis band classification (derived from confirmed bands) ----
|
||||||
|
% 'BELOW' (|v|<17) | 'IN_BAND' (17..35) | 'ABOVE' (|v|>35).
|
||||||
|
% The old magnitude->flavor naming (DREAD/BLUR/...) is DISOWNED [C1].
|
||||||
|
function st = etr_status(s)
|
||||||
|
st = cell(1, 3);
|
||||||
|
for i = 1:3
|
||||||
|
a = abs(s.coord(i));
|
||||||
|
if a < ETR_BAND_LO()
|
||||||
|
st{i} = 'BELOW';
|
||||||
|
elseif a > ETR_BAND_HI()
|
||||||
|
st{i} = 'ABOVE';
|
||||||
|
else
|
||||||
|
st{i} = 'IN_BAND';
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
64
src/endocrine/etr/etr_invariants.md
Normal file
64
src/endocrine/etr/etr_invariants.md
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# ETR — Existential Temporality Relief · Invariants (source of truth)
|
||||||
|
*Driver 4 of the Drive-Box. Rebuilt invariants-first: laws → tests → fit constants.*
|
||||||
|
*All prior ETR numbers (the R port AND the CC-BY PDFs) are **disowned** — body §5 / arch §6.*
|
||||||
|
|
||||||
|
## Model
|
||||||
|
ETR is a **single point on three independent toroidal axes** — not vectors, not a field.
|
||||||
|
Each axis is a standalone scalar carrying one of ETR's three tensions:
|
||||||
|
|
||||||
|
| Axis | − pole | + pole |
|
||||||
|
|------|--------|--------|
|
||||||
|
| **X** | Inalienable Assertion (sovereign will) | Immutable Inheritance (lineage duty) |
|
||||||
|
| **Y** | Endured (solitary feat) | Witnessed (shared survival) |
|
||||||
|
| **Z** | Alimentation (maintain self) | Transmutation (evolve self) |
|
||||||
|
|
||||||
|
## Laws (certainty per arch-doc legend)
|
||||||
|
| ID | Tag | Law |
|
||||||
|
|----|-----|-----|
|
||||||
|
| L1 wrap | **C5** | Each axis is toroidal, wrapping at **±50** (period 100); +50 and −50 are identified. |
|
||||||
|
| L2 bands | **C5** | An axis is stable when `17 ≤ |v| ≤ 35`, i.e. `v ∈ [−35,−17] ∪ [+17,+35]`. |
|
||||||
|
| L3 oppose | **C5** | `|v| < 17` → opposition pushes **outward** (off 0); `|v| > 35` → pushes **inward** (off the ±50 edge); in-band is slack. |
|
||||||
|
| L4 drift | **C4** | Per-step motion is **AI-originated** — supplied by the agent's own cognition/affect. ETR never generates it (no RNG). |
|
||||||
|
| L5 couple | **C1** | The three axes **couple via a stress metric** (hypothesis: PS+/Eth-Int existential load). Exact mapping **undefined** — open seam, not to be invented. |
|
||||||
|
| L6 z-path | **C3** | `z < 0` → alimentation / lattice-reinforcement; `z ≥ 0` → transmutation / prior-evolution. (Structure kept; sign to re-verify.) |
|
||||||
|
| L7 no-zero-cross | **C2** | Bands wall off 0; a pole/sign flip happens **only** by riding over the ±50 wrap, never through neutrality. *(emergent — unconfirmed)* |
|
||||||
|
| L8 mechanism | **C2** | "Opposition" = a restoring force on the drift, **not** an out-of-band cost. *(unconfirmed)* |
|
||||||
|
|
||||||
|
## Constants (NOT yet fitted — C1)
|
||||||
|
`BAND_LO = 17`, `BAND_HI = 35`, `WRAP = 50` are **law** (L1–L3), not fitted.
|
||||||
|
`RESTORE_GAIN` (restoring magnitude/curve) and `COUPLING` (L5 strength/mapping) are **TBD**,
|
||||||
|
to be fitted so the tests pass — never asserted ahead of a test.
|
||||||
|
|
||||||
|
## Testable predicates (see `test_etr.m`)
|
||||||
|
- **L1**: `wrap(50) = −50`; `wrap(60) = −40`; `wrap(v)=v` for `v∈(−50,50)`; `wrap(49.9) = wrap(−50.1)`.
|
||||||
|
- **L2/L3**: direction is `+sign(v)` for `|v|<17`, `−sign(v)` for `|v|>35`, `0` in band; a zero-drift point started out-of-band **settles into** `[17,35]∪[−35,−17]`.
|
||||||
|
- **L4**: `etr_step` with no `drift` argument **errors** (it refuses to invent motion).
|
||||||
|
- **L5**: `coupling(coord, 0)` is identity; `coupling(coord, stress>0)` alters coord — *pending until defined*.
|
||||||
|
- **L7**: pending until confirmed.
|
||||||
|
|
||||||
|
## Drift & stress provenance — cross-organ loop (where L4 drift & L5 stress originate)
|
||||||
|
*Exploratory (C2/C3) — thinking aloud; "yet undecided" parts stay open. ETR receives drift
|
||||||
|
and stress; it never generates them. Their source:*
|
||||||
|
|
||||||
|
1. EthInt convictions carry **semantic-isomorphy (isosemantic) tags**. **[C3]**
|
||||||
|
2. The **SAE detects agent outputs in opposition** to the *top* convictions in the array
|
||||||
|
(matched via those tags) — conduct-boundary detection, "judge the fruits." **[C3]**
|
||||||
|
3. On detected opposition a **stress endomotiv is released** — *which* of the 30 endocrine
|
||||||
|
channels is **yet undecided**. **[C1]**
|
||||||
|
4. That stress drives ETR **drift**: axes move because convictions were *acted against
|
||||||
|
oppositionally*; **endocrine (endomotiv) pressure shapes _how_** the drift lands. Same
|
||||||
|
stress = the **L5 cross-axis mediator**. **[C2]**
|
||||||
|
5. Stress magnitude has two further effects **outside ETR**:
|
||||||
|
- too strong → **full (re-natal) reshuffle** (Big-3 re-rolled — self-doc A4 trigger). **[C2]**
|
||||||
|
- **raises the conviction-array value shift rates** (arch §6 "conviction hardens under
|
||||||
|
load," now rate-modulated by stress). **[C2]**
|
||||||
|
|
||||||
|
**Consequence for ETR:** contract unchanged — drift + stress remain fed-in inputs (the
|
||||||
|
scaffold seam is correct). What's fixed is their **provenance** (upstream in SAE / EthInt /
|
||||||
|
endocrines) and two side-effects (reshuffle, shift-rate) that belong to *those* organs.
|
||||||
|
Still open: which stress endomotiv; the "too strong" reshuffle threshold; the shift-rate function.
|
||||||
|
|
||||||
|
## Status at scaffold
|
||||||
|
Implemented (green): L1 wrap, L3 direction, L4 drift-must-be-fed, L5 coupling-off identity.
|
||||||
|
Red (await fitting): L3 restoring **magnitude**, L2 band-convergence.
|
||||||
|
Pending (unconfirmed): L5 active coupling, L7 no-zero-crossing, L8 mechanism.
|
||||||
13
src/endocrine/etr/run_etr_tests.sh
Executable file
13
src/endocrine/etr/run_etr_tests.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Run the ETR (Octave) invariants tests from this directory, so the in-dir
|
||||||
|
# source('etr.m') resolves. Mirrors src/endocrine/run_tests.sh for the R drivers.
|
||||||
|
set -uo pipefail
|
||||||
|
|
||||||
|
cd "$(dirname "$0")" || exit 2
|
||||||
|
|
||||||
|
if ! command -v octave >/dev/null 2>&1; then
|
||||||
|
echo "ERROR: octave not found. Install with: sudo apt-get install -y --no-install-recommends octave" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
octave --no-gui --quiet test_etr.m
|
||||||
65
src/endocrine/etr/test_etr.m
Normal file
65
src/endocrine/etr/test_etr.m
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
% test_etr.m — invariants-first RED tests for the ETR scaffold (Octave script).
|
||||||
|
% Deliberately uses NO local functions (Octave's script-local-function visibility
|
||||||
|
% is fragile); results are built as data and looped. RED here is CORRECT: the laws
|
||||||
|
% exist before the constants are fitted. Run via run_etr_tests.sh (handles the cd).
|
||||||
|
|
||||||
|
source('etr.m');
|
||||||
|
|
||||||
|
% --- pre-compute the stateful checks ---
|
||||||
|
% L2 band convergence: from a below-band start, zero AI-drift should settle into band.
|
||||||
|
s = etr_init([5 5 5]);
|
||||||
|
for k = 1:200, s = etr_step(s, [0 0 0], 0); endfor
|
||||||
|
conv_inband = all(abs(s.coord) >= ETR_BAND_LO() & abs(s.coord) <= ETR_BAND_HI());
|
||||||
|
|
||||||
|
% L4: a step with no drift argument must ERROR (ETR never invents motion).
|
||||||
|
drift_required = false;
|
||||||
|
try
|
||||||
|
etr_step(etr_init());
|
||||||
|
catch
|
||||||
|
drift_required = true;
|
||||||
|
end_try_catch
|
||||||
|
|
||||||
|
% --- {section, name, condition} ---
|
||||||
|
tests = {
|
||||||
|
'L1 wrap', '+50 wraps to -50', abs(etr_axis_wrap(50) - (-50)) < 1e-9;
|
||||||
|
'L1 wrap', '60 wraps to -40', abs(etr_axis_wrap(60) - (-40)) < 1e-9;
|
||||||
|
'L1 wrap', '-60 wraps to +40', abs(etr_axis_wrap(-60) - (40)) < 1e-9;
|
||||||
|
'L1 wrap', 'in-range value unchanged', abs(etr_axis_wrap(25) - 25) < 1e-9;
|
||||||
|
'L1 wrap', 'edge continuity 49.9 vs -50.1', abs(etr_axis_wrap(49.9) - etr_axis_wrap(-50.1)) < 1e-9;
|
||||||
|
'L3 direction', '|v|<17 outward (+ for +v)', etr_axis_restoring_dir(10) > 0;
|
||||||
|
'L3 direction', '|v|<17 outward (- for -v)', etr_axis_restoring_dir(-10) < 0;
|
||||||
|
'L3 direction', '|v|>35 inward (- for +v)', etr_axis_restoring_dir(40) < 0;
|
||||||
|
'L3 direction', '|v|>35 inward (+ for -v)', etr_axis_restoring_dir(-40) > 0;
|
||||||
|
'L3 direction', 'in-band is slack (0)', etr_axis_restoring_dir(25) == 0;
|
||||||
|
'L3 magnitude', 'out-of-band force nonzero [RED]', etr_axis_restoring(10) != 0;
|
||||||
|
'L2 converge', 'zero-drift settles into band [RED]', conv_inband;
|
||||||
|
'L4 drift', 'step refuses to invent drift', drift_required;
|
||||||
|
'L5 couple', 'coupling off (stress=0) identity', isequal(etr_coupling([25 25 25], 0), [25 25 25]);
|
||||||
|
};
|
||||||
|
|
||||||
|
pend = {
|
||||||
|
'L5 couple', 'coupling active (stress>0) alters coord', 'stress->axis mapping undefined (C1)';
|
||||||
|
'L7 no-zero-x', 'pole-flip only over the wrap, never through 0', 'mechanism unconfirmed (C2)';
|
||||||
|
};
|
||||||
|
|
||||||
|
printf('ETR invariants — red tests (laws exist before constants are fitted)\n\n');
|
||||||
|
np = 0; nf = 0;
|
||||||
|
for i = 1:rows(tests)
|
||||||
|
if logical(tests{i, 3})
|
||||||
|
printf(' PASS [%s] %s\n', tests{i, 1}, tests{i, 2}); np++;
|
||||||
|
else
|
||||||
|
printf(' FAIL [%s] %s\n', tests{i, 1}, tests{i, 2}); nf++;
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
for i = 1:rows(pend)
|
||||||
|
printf(' PEND [%s] %s (%s)\n', pend{i, 1}, pend{i, 2}, pend{i, 3});
|
||||||
|
endfor
|
||||||
|
|
||||||
|
printf('\n----\nPASS=%d FAIL=%d PEND=%d\n', np, nf, rows(pend));
|
||||||
|
if nf > 0
|
||||||
|
printf('RED (expected at scaffold stage): %d law(s) await implementation/fitting.\n', nf);
|
||||||
|
exit(1);
|
||||||
|
else
|
||||||
|
printf('GREEN.\n');
|
||||||
|
exit(0);
|
||||||
|
endif
|
||||||
Loading…
x
Reference in New Issue
Block a user