Skip to content

Commit afab56f

Browse files
committed
Science Commit 5.
1 parent 97bc63b commit afab56f

5 files changed

Lines changed: 232 additions & 10 deletions

File tree

FILETYPES.md

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ Students: Available on the 8th Floor after 8
1515
|------|-----------|----------------|------------|----------------|
1616
| 1 | `.rmds` | **Most Carefully Secure** | Immutable / Locked | Owner only (Max Rupplin — MEARVK LLC) |
1717
| 2 | `.rdns` | **Very Secure** | Read-only / Structural | Owner only |
18-
| 3 | `.key` | **Secure** | Never transmitted publicly | Owner retains local copies |
19-
| 4 | `.csvmd` | **Protected** | Append-only ethical codes | Author-trusted (9.5+/10) |
20-
| 5 | `.xml` | **Controlled** | Configurable at boot | Admin (Rank 6+) |
21-
| 6 | `.csv` | **Standard** | Read/write data | System or Admin |
22-
| 7 | `.txt` | **Informational** | Freely editable | Any authorized user |
18+
| 3 | `.CDNS` | **Secure — Eigen Matrix** | Immutable after creation | Owner only |
19+
| 4 | `.key` | **Secure** | Never transmitted publicly | Owner retains local copies |
20+
| 5 | `.csvmd` | **Protected** | Append-only ethical codes | Author-trusted (9.5+/10) |
21+
| 6 | `.xml` | **Controlled** | Configurable at boot | Admin (Rank 6+) |
22+
| 7 | `.csv` | **Standard** | Read/write data | System or Admin |
23+
| 8 | `.txt` | **Informational** | Freely editable | Any authorized user |
2324

2425
---
2526

@@ -69,9 +70,41 @@ Structural definition files using reverse-DNS notation (e.g., `us.mearvk.futures
6970

7071
---
7172

73+
## .CDNS — Canonical Dense Numeric Structure (Eigen Matrix)
74+
75+
**Security:** Secure — Eigen Matrix (Rank 3)
76+
77+
Eigenvector and eigenmatrix storage files. Each file contains a named matrix in a tagged block (`[EV:Name]...[/EV:Name]`) with fixed-width numeric entries. Immutable after creation — these represent mathematical constants or structural transforms that must not be altered.
78+
79+
**Characteristics:**
80+
- Immutable after initial creation by the Owner
81+
- Tagged block format: `[EV:MatrixName]` ... `[/EV:MatrixName]`
82+
- Fixed-dimension dense matrices (space-separated values)
83+
- Header contains name, dimensions, author, creation date
84+
- Stored in `math/eigenlocator/` directory
85+
- Used for structural transforms, anatomical mappings, signal processing
86+
87+
**Format:**
88+
```
89+
[EV:BasicAnatomy]
90+
42 0 0 1 42
91+
0 4 1 1 4
92+
0 1 1 4 2
93+
0 1 1 4 42
94+
0 9 0 0 1
95+
[/EV:BasicAnatomy]
96+
```
97+
98+
**Examples:**
99+
- `math/eigenlocator/BasicAnatomy.CDNS` — 5×5 eigenvector matrix
100+
101+
**Located:** `math/eigenlocator/`
102+
103+
---
104+
72105
## .key — Cryptographic Key Files
73106

74-
**Security:** Secure (Rank 3)
107+
**Security:** Secure (Rank 4)
75108

76109
Authorization and identity files used for boot-time verification, module signing, and Rank 4 server registration. The `public.key` authorizes system operation when present on GitHub. The `secret.key` never leaves the Owner's machine.
77110

@@ -93,7 +126,7 @@ Authorization and identity files used for boot-time verification, module signing
93126

94127
## .csvmd — Comma-Separated Values with Moral Definitions
95128

96-
**Security:** Protected (Rank 4)
129+
**Security:** Protected (Rank 5)
97130

98131
Hybrid files combining CSV tabular data with ethical/moral header documentation. Used exclusively by the AuditorContentModule for trust code definitions. Each row defines a moral principle with its domain, description, and weight.
99132

@@ -119,7 +152,7 @@ code,domain,principle,weight
119152

120153
## .xml — Extensible Markup Language Configuration
121154

122-
**Security:** Controlled (Rank 5)
155+
**Security:** Controlled (Rank 6)
123156

124157
System configuration files read at boot time. Control service enablement, port assignments, database connections, module registration, print formatting, and protocol handlers. Modifications require Admin (Rank 6+) authority.
125158

@@ -143,7 +176,7 @@ System configuration files read at boot time. Control service enablement, port a
143176

144177
## .csv — Comma-Separated Values Data
145178

146-
**Security:** Standard (Rank 6)
179+
**Security:** Standard (Rank 7)
147180

148181
Plain data files for trade records, address records, safety ledgers, test results, and bulk data storage. System-generated and system-consumed. No inherent security beyond filesystem permissions.
149182

@@ -164,7 +197,7 @@ Plain data files for trade records, address records, safety ledgers, test result
164197

165198
## .txt — Plain Text Documentation
166199

167-
**Security:** Informational (Rank 7)
200+
**Security:** Informational (Rank 8)
168201

169202
Human-readable documentation, structure listings, and reference files. Freely editable by any authorized user. No system enforcement on content.
170203

math/eigen-config.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- Eigenvector Math Configuration — MEARVK LLC -->
3+
<eigen-config>
4+
<eigenlocator-dir>math/eigenlocator</eigenlocator-dir>
5+
<observations-dir>math/observations</observations-dir>
6+
<output-dir>math/results</output-dir>
7+
<matrices>
8+
<matrix name="BasicAnatomy" file="BasicAnatomy.CDNS" rows="5" cols="5"/>
9+
</matrices>
10+
</eigen-config>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CDNS Eigenvector File — Canonical Dense Numeric Structure
2+
# Name: BasicAnatomy
3+
# Dimensions: 5x5
4+
# Author: Max Rupplin — MEARVK LLC
5+
# Created: 2026-06-26
6+
# Security: .CDNS (Eigen Matrix — Immutable after creation)
7+
8+
[EV:BasicAnatomy]
9+
42 0 0 1 42
10+
0 4 1 1 4
11+
0 1 1 4 2
12+
0 1 1 4 42
13+
0 9 0 0 1
14+
[/EV:BasicAnatomy]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# National Observation Input — Sample
2+
# Each line is a 5-element vector to multiply through BasicAnatomy EV
3+
# Format: v1 v2 v3 v4 v5
4+
1.0 2.0 3.0 4.0 5.0
5+
0.5 1.0 1.5 2.0 2.5

source/math/EigenMultiplier.java

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
package math;
2+
3+
import java.io.*;
4+
import java.nio.file.*;
5+
import java.util.*;
6+
import javax.xml.parsers.DocumentBuilderFactory;
7+
import org.w3c.dom.*;
8+
9+
/**
10+
* EigenMultiplier — Reads national observation vectors from math/observations/
11+
* and multiplies them through Eigenvector matrices defined in .CDNS files.
12+
*
13+
* Usage: java math.EigenMultiplier [observation-file]
14+
* If no file specified, processes all files in observations directory.
15+
*
16+
* Observation file format (one vector per line, space-separated):
17+
* 1.0 2.0 3.0 4.0 5.0
18+
*
19+
* Output: resultant vector after matrix multiplication (Ax = y)
20+
*/
21+
public class EigenMultiplier {
22+
23+
private static final String CONFIG_PATH = "math/eigen-config.xml";
24+
25+
private String eigenlocatorDir;
26+
private String observationsDir;
27+
private String outputDir;
28+
private final Map<String, double[][]> matrices = new LinkedHashMap<>();
29+
30+
public static void main(String... args) throws Exception {
31+
EigenMultiplier em = new EigenMultiplier();
32+
em.loadConfig();
33+
em.loadMatrices();
34+
35+
if (args.length > 0) {
36+
em.processObservation(Path.of(em.observationsDir, args[0]));
37+
} else {
38+
em.processAllObservations();
39+
}
40+
}
41+
42+
private void loadConfig() throws Exception {
43+
Document doc = DocumentBuilderFactory.newInstance()
44+
.newDocumentBuilder().parse(new File(CONFIG_PATH));
45+
doc.getDocumentElement().normalize();
46+
47+
eigenlocatorDir = doc.getElementsByTagName("eigenlocator-dir").item(0).getTextContent();
48+
observationsDir = doc.getElementsByTagName("observations-dir").item(0).getTextContent();
49+
outputDir = doc.getElementsByTagName("output-dir").item(0).getTextContent();
50+
51+
new File(outputDir).mkdirs();
52+
}
53+
54+
private void loadMatrices() throws Exception {
55+
File dir = new File(eigenlocatorDir);
56+
for (File f : dir.listFiles((d, n) -> n.endsWith(".CDNS"))) {
57+
parseCDNS(f);
58+
}
59+
System.out.println("[EigenMultiplier] Loaded " + matrices.size() + " matrix(es)");
60+
}
61+
62+
private void parseCDNS(File file) throws IOException {
63+
List<String> lines = Files.readAllLines(file.toPath());
64+
String name = null;
65+
List<double[]> rows = new ArrayList<>();
66+
67+
for (String line : lines) {
68+
String trimmed = line.trim();
69+
if (trimmed.startsWith("[EV:") && !trimmed.startsWith("[/EV:")) {
70+
name = trimmed.substring(4, trimmed.length() - 1);
71+
rows.clear();
72+
} else if (trimmed.startsWith("[/EV:")) {
73+
if (name != null && !rows.isEmpty()) {
74+
matrices.put(name, rows.toArray(new double[0][]));
75+
}
76+
name = null;
77+
} else if (name != null && !trimmed.isEmpty() && !trimmed.startsWith("#")) {
78+
String[] parts = trimmed.split("\\s+");
79+
double[] row = new double[parts.length];
80+
for (int i = 0; i < parts.length; i++) row[i] = Double.parseDouble(parts[i]);
81+
rows.add(row);
82+
}
83+
}
84+
}
85+
86+
private void processAllObservations() throws Exception {
87+
File dir = new File(observationsDir);
88+
File[] files = dir.listFiles((d, n) -> !n.startsWith("."));
89+
if (files == null || files.length == 0) {
90+
System.out.println("[EigenMultiplier] No observation files in " + observationsDir);
91+
return;
92+
}
93+
for (File f : files) {
94+
processObservation(f.toPath());
95+
}
96+
}
97+
98+
private void processObservation(Path obsPath) throws Exception {
99+
if (!Files.exists(obsPath)) {
100+
System.err.println("[EigenMultiplier] Not found: " + obsPath);
101+
return;
102+
}
103+
104+
System.out.println("[EigenMultiplier] Processing: " + obsPath.getFileName());
105+
List<String> lines = Files.readAllLines(obsPath);
106+
StringBuilder output = new StringBuilder();
107+
output.append("# Results for: ").append(obsPath.getFileName()).append("\n");
108+
109+
for (Map.Entry<String, double[][]> entry : matrices.entrySet()) {
110+
String matName = entry.getKey();
111+
double[][] matrix = entry.getValue();
112+
output.append("# Matrix: ").append(matName).append("\n");
113+
114+
for (String line : lines) {
115+
String trimmed = line.trim();
116+
if (trimmed.isEmpty() || trimmed.startsWith("#")) continue;
117+
118+
double[] vec = parseVector(trimmed);
119+
if (vec.length != matrix[0].length) {
120+
output.append("# ERROR: vector length ").append(vec.length)
121+
.append(" != matrix cols ").append(matrix[0].length).append("\n");
122+
continue;
123+
}
124+
125+
double[] result = multiply(matrix, vec);
126+
output.append(formatVector(result)).append("\n");
127+
}
128+
}
129+
130+
Path outPath = Path.of(outputDir, obsPath.getFileName().toString() + ".result");
131+
Files.writeString(outPath, output.toString());
132+
System.out.println("[EigenMultiplier] Output: " + outPath);
133+
}
134+
135+
private double[] multiply(double[][] matrix, double[] vec) {
136+
double[] result = new double[matrix.length];
137+
for (int i = 0; i < matrix.length; i++) {
138+
for (int j = 0; j < vec.length; j++) {
139+
result[i] += matrix[i][j] * vec[j];
140+
}
141+
}
142+
return result;
143+
}
144+
145+
private double[] parseVector(String line) {
146+
String[] parts = line.trim().split("\\s+");
147+
double[] v = new double[parts.length];
148+
for (int i = 0; i < parts.length; i++) v[i] = Double.parseDouble(parts[i]);
149+
return v;
150+
}
151+
152+
private String formatVector(double[] v) {
153+
StringBuilder sb = new StringBuilder();
154+
for (int i = 0; i < v.length; i++) {
155+
if (i > 0) sb.append(" ");
156+
sb.append(String.format("%.4f", v[i]));
157+
}
158+
return sb.toString();
159+
}
160+
}

0 commit comments

Comments
 (0)