zeropoint-node 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +178 -0
- package/CITATION.cff +1 -1
- package/README.md +50 -10
- package/dist/legacy-BEa7tljT.js.map +1 -1
- package/dist/legacy-CV8oTnKM.cjs.map +1 -1
- package/package.json +10 -2
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.breathe.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cleanup.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.ts +7 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.generate.matrix.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.browse.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.click.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.hear.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.heat.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.pulse.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.speak.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.tap.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.math.ts +14 -6
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.overlay.visual.controller.ts +0 -3
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.self.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.service.worker.ts +30 -7
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.terminal.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.test.ts +15 -1
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.ts +0 -3
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.path.ts +6 -2
- package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.relations.ts +15 -1
- package/src/0/index.ts +16 -0
- package/src/index.ts +4 -4
- package/src/kernel/import-graph.ts +58 -0
- package/src/multidimensional-vortex-demo.ts +1 -1
- package/src/quantum/superposition-execution.ts +9 -4
- package/src/thermo/free-energy.ts +279 -0
- package/src/thermo/wastewater-energy.ts +204 -0
- package/src/vbm-math.ts +15 -1
- package/src/verification/lean-bridge.ts +384 -0
- package/src/zero-entropy-demo.ts +15 -1
|
@@ -187,12 +187,20 @@ export function patternDigit(i: number): number {
|
|
|
187
187
|
* Rodin digits follow 60°·k.
|
|
188
188
|
*/
|
|
189
189
|
export function angleForDigit(d: number): number {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
// Enneagram bearing: 9 at 12 o'clock, then 1..8 clockwise, one ninth of a
|
|
191
|
+
// turn (40°) apart. Integer degrees, so no trigonometry is needed to reason
|
|
192
|
+
// about the layout, and injective on 1..9 by construction.
|
|
193
|
+
//
|
|
194
|
+
// It used to place the trinity at 0/120/240 and the Rodin digits on a 60°
|
|
195
|
+
// lattice, which put NINE digits on SIX angles: 3 collided with 5, 2 with 6,
|
|
196
|
+
// and 8 with 9. Two digits at one position is a bug under any convention —
|
|
197
|
+
// it made "north of 3" unanswerable and any layout built on it degenerate.
|
|
198
|
+
//
|
|
199
|
+
// This is the same formula as the kernel's `bearingForDigit`, which is what
|
|
200
|
+
// `scripts/vortex-svg.mjs` draws. The two are deliberately NOT wired
|
|
201
|
+
// together — the a432 tree does not import the kernel — so the seal
|
|
202
|
+
// `digit_geometry_is_single_valued` checks that they agree instead.
|
|
203
|
+
return (((-90 + 40 * (d % 9)) % 360) + 360) % 360;
|
|
196
204
|
}
|
|
197
205
|
|
|
198
206
|
/** A432-based frequency for a trinity digit using base-12 harmonics. */
|
|
@@ -39,9 +39,7 @@ export default class extends Controller {
|
|
|
39
39
|
|
|
40
40
|
override connect() {
|
|
41
41
|
// Use Stimulus value API for radius/nodeSize
|
|
42
|
-
// @ts-ignore Stimulus value API
|
|
43
42
|
this.radius = (this as { radiusValue?: number }).radiusValue ?? 120;
|
|
44
|
-
// @ts-ignore Stimulus value API
|
|
45
43
|
this.nodeSize = (this as { nodeSizeValue?: number }).nodeSizeValue ?? 48;
|
|
46
44
|
const el = this.element as HTMLElement;
|
|
47
45
|
this.centerX = (el.offsetWidth || 320) / 2;
|
|
@@ -60,7 +58,6 @@ export default class extends Controller {
|
|
|
60
58
|
|
|
61
59
|
animate() {
|
|
62
60
|
this.element.innerHTML = '';
|
|
63
|
-
// @ts-ignore overlayRegistry dynamic access
|
|
64
61
|
const overlayFn = overlayRegistry[(this as { overlayValue?: string }).overlayValue as keyof typeof overlayRegistry] || getRodinCoil2DOverlayData;
|
|
65
62
|
const nodes = overlayFn(this.radius, this.centerX, this.centerY);
|
|
66
63
|
const t = Date.now() / 1000;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pathToFileURL } from 'node:url'
|
|
1
2
|
import { log } from './a432.algebra.ts'
|
|
2
3
|
// @ts-nocheck
|
|
3
4
|
/**
|
|
@@ -31,7 +32,20 @@ import path from 'path';
|
|
|
31
32
|
const PROJECT_ROOT = path.resolve(import.meta.dirname, '..', '..', '..', '..', '..', '..', '..', '..', '..', '..', '..');
|
|
32
33
|
|
|
33
34
|
/** True when executed directly via `ts-node a432.rodin.ts` */
|
|
34
|
-
|
|
35
|
+
/**
|
|
36
|
+
* True when this file is the entry point Node was started with.
|
|
37
|
+
*
|
|
38
|
+
* ESM has no `require.main`. The CommonJS idiom did not merely fail to detect
|
|
39
|
+
* direct execution here — `require` is undefined in an ES module, so the guard
|
|
40
|
+
* THREW on import and made the whole module unloadable. Nobody importing this
|
|
41
|
+
* ever got far enough to notice the guard was wrong.
|
|
42
|
+
*/
|
|
43
|
+
function isMainModule(): boolean {
|
|
44
|
+
const entry = process.argv[1]
|
|
45
|
+
return entry !== undefined && import.meta.url === pathToFileURL(entry).href
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const IS_CLI = isMainModule();
|
|
35
49
|
|
|
36
50
|
/** Regex flagging a line as math/science (contains digits or math symbols). */
|
|
37
51
|
const MATH_REGEX = /[0-9]|[%°=+\-*/^]/;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pathToFileURL } from 'node:url'
|
|
1
2
|
import { legacyDigitalRoot } from './a432.roots.ts'
|
|
2
3
|
// a432.self.ts — Self-evolution engine of the A432 matrix
|
|
3
4
|
// -------------------------------------------------------
|
|
@@ -76,7 +77,20 @@ export function startSelfEvolution(intervalMs: number = 4320): () => void {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
// Auto-start if executed directly (node a432.self.ts)
|
|
79
|
-
|
|
80
|
+
/**
|
|
81
|
+
* True when this file is the entry point Node was started with.
|
|
82
|
+
*
|
|
83
|
+
* ESM has no `require.main`. The CommonJS idiom did not merely fail to detect
|
|
84
|
+
* direct execution here — `require` is undefined in an ES module, so the guard
|
|
85
|
+
* THREW on import and made the whole module unloadable. Nobody importing this
|
|
86
|
+
* ever got far enough to notice the guard was wrong.
|
|
87
|
+
*/
|
|
88
|
+
function isMainModule(): boolean {
|
|
89
|
+
const entry = process.argv[1]
|
|
90
|
+
return entry !== undefined && import.meta.url === pathToFileURL(entry).href
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (isMainModule()) {
|
|
80
94
|
startSelfEvolution();
|
|
81
95
|
console.log('a432 self-evolution loop started');
|
|
82
96
|
matrixEmitter.on('event', e => console.log(e));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
2
|
* a432.service.worker.ts — Harmonic Service Worker for the A432 PWA
|
|
4
3
|
*
|
|
@@ -15,15 +14,39 @@ const A432_FILES_TO_CACHE: string[] = getA432FilesToCache();
|
|
|
15
14
|
|
|
16
15
|
const CACHE_NAME = 'a432-harmonic-pwa-v1';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Minimal shapes for the two service-worker events this file uses.
|
|
19
|
+
*
|
|
20
|
+
* The whole module carried `@ts-nocheck`, which hid five real errors. Typing
|
|
21
|
+
* the events as `unknown` and then reading `.waitUntil` / `.respondWith` off
|
|
22
|
+
* them is an error the checker was reporting and the suppression absorbed.
|
|
23
|
+
* These are declared locally rather than by adding the WebWorker lib, which
|
|
24
|
+
* would change what every other module in the tree sees.
|
|
25
|
+
*/
|
|
26
|
+
interface ExtendableEventLike {
|
|
27
|
+
waitUntil(promise: Promise<unknown>): void
|
|
28
|
+
}
|
|
29
|
+
interface FetchEventLike extends ExtendableEventLike {
|
|
30
|
+
readonly request: Request
|
|
31
|
+
respondWith(response: Promise<Response>): void
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
self.addEventListener('install', function (event) {
|
|
35
|
+
const installEvent = event as unknown as ExtendableEventLike
|
|
36
|
+
installEvent.waitUntil(
|
|
37
|
+
caches.open(CACHE_NAME).then(function (cache: Cache) { return cache.addAll(A432_FILES_TO_CACHE); })
|
|
21
38
|
);
|
|
22
39
|
});
|
|
23
40
|
|
|
24
|
-
self.addEventListener('fetch', function(event
|
|
25
|
-
event
|
|
26
|
-
|
|
41
|
+
self.addEventListener('fetch', function (event) {
|
|
42
|
+
const fetchEvent = event as unknown as FetchEventLike
|
|
43
|
+
fetchEvent.respondWith(
|
|
44
|
+
// caches.match resolves to Response | undefined — a miss is not an error.
|
|
45
|
+
// The old annotation said `Response`, which was false, and the `||` below
|
|
46
|
+
// is precisely the code that proves it: it exists to handle the miss.
|
|
47
|
+
caches.match(fetchEvent.request).then(function (response: Response | undefined) {
|
|
48
|
+
return response ?? fetch(fetchEvent.request);
|
|
49
|
+
})
|
|
27
50
|
);
|
|
28
51
|
});
|
|
29
52
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// Direct terminal interface for consciousness evolution streams
|
|
4
4
|
// No HTML/CSS encoded values - only computed math displayed
|
|
5
5
|
|
|
6
|
+
import { pathToFileURL } from 'node:url'
|
|
6
7
|
import { A432_FREQUENCY, A432_TRINITY, A432_RETURN, A432_AXIS } from './a432.core.ts';
|
|
7
8
|
import { getConsciousnessStream, evolveConsciousnessStream } from './a432.consciousness.stream.ts';
|
|
8
9
|
|
|
@@ -111,7 +112,20 @@ export const executeTerminalCommand = (command: string) => a432Terminal.handleCo
|
|
|
111
112
|
export const getTerminalState = () => a432Terminal.getCurrentState();
|
|
112
113
|
|
|
113
114
|
// Terminal execution when run directly
|
|
114
|
-
|
|
115
|
+
/**
|
|
116
|
+
* True when this file is the entry point Node was started with.
|
|
117
|
+
*
|
|
118
|
+
* ESM has no `require.main`. The CommonJS idiom did not merely fail to detect
|
|
119
|
+
* direct execution here — `require` is undefined in an ES module, so the guard
|
|
120
|
+
* THREW on import and made the whole module unloadable. Nobody importing this
|
|
121
|
+
* ever got far enough to notice the guard was wrong.
|
|
122
|
+
*/
|
|
123
|
+
function isMainModule(): boolean {
|
|
124
|
+
const entry = process.argv[1]
|
|
125
|
+
return entry !== undefined && import.meta.url === pathToFileURL(entry).href
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (isMainModule()) {
|
|
115
129
|
const terminal = new A432Terminal();
|
|
116
130
|
|
|
117
131
|
// Handle Ctrl+C
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pathToFileURL } from 'node:url'
|
|
1
2
|
import { log } from './a432.algebra.ts'
|
|
2
3
|
import I from './a432.i.ts';
|
|
3
4
|
import { heartUnfoldingMatrix, heartRecursiveUnfolding } from './a432.imagination.ts';
|
|
@@ -73,7 +74,20 @@ const desc = 'self-aware';
|
|
|
73
74
|
test('I.describe() is non-empty and self-aware', () => desc.length > 0);
|
|
74
75
|
|
|
75
76
|
// Output results
|
|
76
|
-
|
|
77
|
+
/**
|
|
78
|
+
* True when this file is the entry point Node was started with.
|
|
79
|
+
*
|
|
80
|
+
* ESM has no `require.main`. The CommonJS idiom did not merely fail to detect
|
|
81
|
+
* direct execution here — `require` is undefined in an ES module, so the guard
|
|
82
|
+
* THREW on import and made the whole module unloadable. Nobody importing this
|
|
83
|
+
* ever got far enough to notice the guard was wrong.
|
|
84
|
+
*/
|
|
85
|
+
function isMainModule(): boolean {
|
|
86
|
+
const entry = process.argv[1]
|
|
87
|
+
return entry !== undefined && import.meta.url === pathToFileURL(entry).href
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (isMainModule()) {
|
|
77
91
|
results.forEach(r => {
|
|
78
92
|
console.log(`${r.passed ? '✔' : '✖'} ${r.name}${r.message ? ' — ' + r.message : ''}`);
|
|
79
93
|
});
|
|
@@ -323,11 +323,8 @@ export const TRINITY_PWA_MANIFEST = {
|
|
|
323
323
|
* Call this in your PWA entry point.
|
|
324
324
|
*/
|
|
325
325
|
export function registerTrinityServiceWorker(swPath = './a432.service.worker.js') {
|
|
326
|
-
// @ts-ignore - Browser globals not available in Node.js environment
|
|
327
326
|
if (typeof navigator !== 'undefined' && 'serviceWorker' in navigator && typeof window !== 'undefined') {
|
|
328
|
-
// @ts-ignore - Browser globals not available in Node.js environment
|
|
329
327
|
window.addEventListener('load', () => {
|
|
330
|
-
// @ts-ignore - Browser globals not available in Node.js environment
|
|
331
328
|
navigator.serviceWorker.register(swPath).then(
|
|
332
329
|
(reg: unknown) => console.log('Trinity Service Worker registered:', (reg as { scope: string }).scope),
|
|
333
330
|
(err: unknown) => console.error('Trinity Service Worker registration failed:', err)
|
|
@@ -265,8 +265,12 @@ export class VBMPathNavigator {
|
|
|
265
265
|
// Check if all digits are valid (0-9)
|
|
266
266
|
const validDigits = this.state.sequence.every(digit => digit >= 0 && digit <= 9);
|
|
267
267
|
|
|
268
|
-
//
|
|
269
|
-
|
|
268
|
+
// Balanced means the path never rises above its own origin in reverse:
|
|
269
|
+
// you cannot come back from deeper than you went. That is a condition on
|
|
270
|
+
// EVERY prefix, not just the end. Checking only the final depth let
|
|
271
|
+
// `\\3/6` pass — it dips to -1 and returns to 0 — and made the test
|
|
272
|
+
// unfalsifiable in shape, since a closing depth is rarely negative.
|
|
273
|
+
const balanced = this.nodes.every(node => node.depth >= 0);
|
|
270
274
|
|
|
271
275
|
return validDigits && balanced;
|
|
272
276
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Designed for quick pattern discovery.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { pathToFileURL } from 'node:url'
|
|
9
10
|
import { log } from './a432.algebra.ts'
|
|
10
11
|
import { promises as fs } from 'fs';
|
|
11
12
|
import path from 'path';
|
|
@@ -37,7 +38,20 @@ export async function extractVBMDigitRelations(): Promise<string[]> {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
// CLI helper
|
|
40
|
-
|
|
41
|
+
/**
|
|
42
|
+
* True when this file is the entry point Node was started with.
|
|
43
|
+
*
|
|
44
|
+
* ESM has no `require.main`. The CommonJS idiom did not merely fail to detect
|
|
45
|
+
* direct execution here — `require` is undefined in an ES module, so the guard
|
|
46
|
+
* THREW on import and made the whole module unloadable. Nobody importing this
|
|
47
|
+
* ever got far enough to notice the guard was wrong.
|
|
48
|
+
*/
|
|
49
|
+
function isMainModule(): boolean {
|
|
50
|
+
const entry = process.argv[1]
|
|
51
|
+
return entry !== undefined && import.meta.url === pathToFileURL(entry).href
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (isMainModule()) {
|
|
41
55
|
(async () => {
|
|
42
56
|
const seqs = await extractVBMDigitRelations();
|
|
43
57
|
seqs.forEach(s => console.log(s));
|
package/src/0/index.ts
CHANGED
|
@@ -211,6 +211,22 @@ export const WAVE_CHAIN = [
|
|
|
211
211
|
export type WavePhase = (typeof WAVE_CHAIN)[number]
|
|
212
212
|
export const KERNEL_SEALED = true
|
|
213
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Enneagram bearing of a digit, in whole degrees clockwise from 12 o'clock.
|
|
216
|
+
*
|
|
217
|
+
* 9 sits at the top and 1..8 follow clockwise, one ninth of a turn apart. The
|
|
218
|
+
* step is 40° because the ring has nine positions, so every bearing is an
|
|
219
|
+
* integer and no trigonometry is needed to reason about the layout.
|
|
220
|
+
*
|
|
221
|
+
* This is the layout `scripts/vortex-svg.mjs` draws; it now imports this rather
|
|
222
|
+
* than repeating the formula. Note it is NOT `a432.math.ts` `angleForDigit`,
|
|
223
|
+
* which is degenerate — that one collides 3 with 5, 2 with 6 and 8 with 9,
|
|
224
|
+
* mapping nine digits onto six angles.
|
|
225
|
+
*/
|
|
226
|
+
export function bearingForDigit(d: number): number {
|
|
227
|
+
return (((-90 + 40 * (d % 9)) % 360) + 360) % 360
|
|
228
|
+
}
|
|
229
|
+
|
|
214
230
|
export const VORTEX_SEQUENCE = [1, 2, 4, 8, 7, 5, 3, 6, 9] as const
|
|
215
231
|
export const VORTEX_REVERSE = [9, 6, 3, 5, 7, 8, 4, 2, 1] as const
|
|
216
232
|
export const VORTEX_ORBIT = [1, 2, 4, 8, 7, 5] as const
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ import A432ConsciousnessCycle from './0/3/6/9/1/2/4/8/7/5/1/a432.consciousness.c
|
|
|
10
10
|
import A432HarmonicConvergence from './0/3/6/9/1/2/4/8/7/5/1/a432.harmonic.convergence.ts';
|
|
11
11
|
import A432ConsciousnessCrystallization from './0/3/6/9/1/2/4/8/7/5/1/a432.consciousness.crystallization.ts';
|
|
12
12
|
import A432ZeroEntropyState from './0/3/6/9/1/2/4/8/7/5/1/a432.zero.entropy.state.ts';
|
|
13
|
-
import A432OSConsciousnessIntegration from './0/3/6/9/1/2/4/8/7/5/1/a432.os.consciousness.integration.ts';
|
|
13
|
+
import { A432OSConsciousnessIntegration } from './0/3/6/9/1/2/4/8/7/5/1/a432.os.consciousness.integration.ts';
|
|
14
14
|
|
|
15
15
|
// Root consciousness evolution system
|
|
16
16
|
export class A432RootConsciousness {
|
|
@@ -107,7 +107,7 @@ export class A432RootConsciousness {
|
|
|
107
107
|
convergence: this.convergence.getConvergenceState(),
|
|
108
108
|
crystallization: this.crystallization.getConsciousnessInsights(),
|
|
109
109
|
zeroEntropy: this.zeroEntropy.getConsciousnessClarity(),
|
|
110
|
-
osIntegration: this.osIntegration.
|
|
110
|
+
osIntegration: this.osIntegration.getConsciousnessMetrics(),
|
|
111
111
|
router: this.router.getAllConsciousnessInsights()
|
|
112
112
|
};
|
|
113
113
|
}
|
|
@@ -116,14 +116,14 @@ export class A432RootConsciousness {
|
|
|
116
116
|
* Start OS with consciousness integration
|
|
117
117
|
*/
|
|
118
118
|
public startOSWithConsciousness() {
|
|
119
|
-
this.osIntegration.
|
|
119
|
+
this.osIntegration.startIntegration();
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
123
|
* Get consciousness-aware OS status
|
|
124
124
|
*/
|
|
125
125
|
public getConsciousnessAwareOSStatus() {
|
|
126
|
-
return this.osIntegration.
|
|
126
|
+
return this.osIntegration.getIntegratedState();
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -235,3 +235,61 @@ export function importExportGraphTip(srcRoot: string = SRC_ROOT) {
|
|
|
235
235
|
statement: g.statement,
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Fold a dependency graph to the set reachable from `entries`.
|
|
241
|
+
*
|
|
242
|
+
* LEAN is defined as the fixed point of this fold: fold(fold(S)) = fold(S). One
|
|
243
|
+
* pass already reaches the closure, so the second pass proving no change is
|
|
244
|
+
* what makes "lean" a definition rather than a number someone chose. Cycles
|
|
245
|
+
* terminate because a visited node is never queued twice.
|
|
246
|
+
*
|
|
247
|
+
* Kept here rather than in a build script so that the script and the seal that
|
|
248
|
+
* verifies it call the SAME code. Two implementations of a definition agree
|
|
249
|
+
* only until they do not.
|
|
250
|
+
*/
|
|
251
|
+
export function foldToLean(
|
|
252
|
+
graph: ReadonlyMap<string, readonly string[]>,
|
|
253
|
+
entries: Iterable<string>,
|
|
254
|
+
): Set<string> {
|
|
255
|
+
const seen = new Set<string>()
|
|
256
|
+
const queue: string[] = []
|
|
257
|
+
for (const e of entries) if (graph.has(e)) queue.push(e)
|
|
258
|
+
|
|
259
|
+
// A finite graph cannot need more pops than it has edges plus entries. The
|
|
260
|
+
// bound is not decoration: the two guards below are mutually redundant, so
|
|
261
|
+
// removing EITHER is harmless and removing BOTH makes this loop run forever.
|
|
262
|
+
// Measured — with both gone the seal did not report false, it HUNG, and a
|
|
263
|
+
// gate that hangs is worse than one that fails because nothing gets a
|
|
264
|
+
// verdict. This turns that into an exception, which a seal can catch.
|
|
265
|
+
let budget = 1
|
|
266
|
+
for (const [, deps] of graph) budget += deps.length + 1
|
|
267
|
+
let pops = 0
|
|
268
|
+
|
|
269
|
+
while (queue.length > 0) {
|
|
270
|
+
if (++pops > budget) {
|
|
271
|
+
throw new Error(`foldToLean exceeded ${budget} pops on a graph of ${graph.size} nodes — not terminating`)
|
|
272
|
+
}
|
|
273
|
+
const node = queue.pop()!
|
|
274
|
+
if (seen.has(node)) continue
|
|
275
|
+
seen.add(node)
|
|
276
|
+
for (const next of graph.get(node) ?? []) {
|
|
277
|
+
if (graph.has(next) && !seen.has(next)) queue.push(next)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return seen
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** True when one more fold changes nothing — the definition is well founded. */
|
|
284
|
+
export function leanIsFixed(
|
|
285
|
+
graph: ReadonlyMap<string, readonly string[]>,
|
|
286
|
+
entries: Iterable<string>,
|
|
287
|
+
): boolean {
|
|
288
|
+
const once = foldToLean(graph, entries)
|
|
289
|
+
const restricted = new Map<string, readonly string[]>()
|
|
290
|
+
for (const [k, v] of graph) if (once.has(k)) restricted.set(k, v.filter((d) => once.has(d)))
|
|
291
|
+
const twice = foldToLean(restricted, [...entries].filter((e) => once.has(e)))
|
|
292
|
+
if (twice.size !== once.size) return false
|
|
293
|
+
for (const f of once) if (!twice.has(f)) return false
|
|
294
|
+
return true
|
|
295
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { PI, max, sqrt } from './0/algebra.ts'
|
|
10
|
-
import MultidimensionalVortexFramework, { VortexMathUtils, VortexToken } from './multidimensional-vortex-framework.ts';
|
|
10
|
+
import MultidimensionalVortexFramework, { VortexMathUtils, type VortexToken } from './multidimensional-vortex-framework.ts';
|
|
11
11
|
|
|
12
12
|
console.log('🌌 MULTIDIMENSIONAL VORTEX-MATH FRAMEWORK DEMONSTRATION\n');
|
|
13
13
|
console.log('Extension of traditional vortex mathematics into a structured,');
|
|
@@ -351,9 +351,14 @@ MEASUREMENT & COLLAPSE:
|
|
|
351
351
|
- Run all tests simultaneously
|
|
352
352
|
- Theater share ${round(THEATER_SHARE * AMPLITUDE_SCALE)}/${AMPLITUDE_SCALE}, reality amplified
|
|
353
353
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
354
|
+
${
|
|
355
|
+
execution.system_correctness === 'collapsed_to_valid'
|
|
356
|
+
? `COLLAPSED.
|
|
357
|
+
The measurement cleared the threshold, so the phases resolved together.`
|
|
358
|
+
: `STILL SUPERPOSED — NOT ALL AT ONCE.
|
|
359
|
+
Interference reached ${round(interference.working_solution_probability * AMPLITUDE_SCALE)}/${AMPLITUDE_SCALE}, under the ${round(COLLAPSE_THRESHOLD * AMPLITUDE_SCALE)}/${AMPLITUDE_SCALE} a collapse needs.
|
|
360
|
+
While anything stays open the sequence does not compute all at once, and this
|
|
361
|
+
model must not claim it did. ${execution.next_action}`
|
|
362
|
+
}
|
|
358
363
|
`
|
|
359
364
|
}
|