Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: correct TSV column mapping and remove Import tab

Adam Eivy7a5ee4e95a30
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx
index 23593a5be5..edcc90063f 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -132,7 +132,6 @@ const navItems = [
children: [
{ to: '/meatspace/alcohol', label: 'Alcohol', icon: Activity },
{ to: '/meatspace/blood', label: 'Blood & Body', icon: HeartPulse },
- { to: '/meatspace/import', label: 'Import', icon: Upload },
{ to: '/meatspace/lifestyle', label: 'Lifestyle', icon: ClipboardList },
{ to: '/meatspace/nutrition', label: 'Nutrition', icon: Flame },
{ to: '/meatspace/overview', label: 'Overview', icon: Activity }
diff --git a/client/src/components/meatspace/constants.js b/client/src/components/meatspace/constants.js
index 67a96cf033..a74dd47b6a 100644
--- a/client/src/components/meatspace/constants.js
+++ b/client/src/components/meatspace/constants.js
@@ -4,7 +4,6 @@ import {
HeartPulse,
ClipboardList,
Apple,
- Upload,
Activity
} from 'lucide-react';
@@ -13,8 +12,7 @@ export const TABS = [
{ id: 'alcohol', label: 'Alcohol', icon: Beer },
{ id: 'blood', label: 'Blood & Body', icon: HeartPulse },
{ id: 'lifestyle', label: 'Lifestyle', icon: ClipboardList },
- { id: 'nutrition', label: 'Nutrition', icon: Apple },
- { id: 'import', label: 'Import', icon: Upload }
+ { id: 'nutrition', label: 'Nutrition', icon: Apple }
];
// Lifestyle adjustment table for death clock
diff --git a/client/src/pages/MeatSpace.jsx b/client/src/pages/MeatSpace.jsx
index 1b8e4217ac..c877732ec6 100644
--- a/client/src/pages/MeatSpace.jsx
+++ b/client/src/pages/MeatSpace.jsx
@@ -8,7 +8,6 @@ import AlcoholTab from '../components/meatspace/tabs/AlcoholTab';
import BloodTab from '../components/meatspace/tabs/BloodTab';
import LifestyleTab from '../components/meatspace/tabs/LifestyleTab';
import NutritionTab from '../components/meatspace/tabs/NutritionTab';
-import ImportTab from '../components/meatspace/tabs/ImportTab';
export default function MeatSpace() {
const { tab } = useParams();
@@ -31,8 +30,6 @@ export default function MeatSpace() {
return <LifestyleTab />;
case 'nutrition':
return <NutritionTab />;
- case 'import':
- return <ImportTab />;
default:
return <OverviewTab />;
}
diff --git a/package-lock.json b/package-lock.json
index 100889fee0..606bfc290c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "portos",
- "version": "1.10.0",
+ "version": "1.10.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "portos",
- "version": "1.10.0",
+ "version": "1.10.1",
"license": "MIT",
"dependencies": {
"express": "^4.21.2",
diff --git a/package.json b/package.json
index cfce1b0518..28b7cee676 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "portos",
- "version": "1.10.0",
+ "version": "1.10.1",
"private": true,
"description": "Local dev machine App OS portal",
"author": "Adam Eivy (@antic|@atomantic)",
diff --git a/server/services/meatspaceImport.js b/server/services/meatspaceImport.js
index 5e60f48270..495a291558 100644
--- a/server/services/meatspaceImport.js
+++ b/server/services/meatspaceImport.js
@@ -15,7 +15,7 @@ const BLOOD_TESTS_FILE = join(MEATSPACE_DIR, 'blood-tests.json');
const EPIGENETIC_TESTS_FILE = join(MEATSPACE_DIR, 'epigenetic-tests.json');
const EYES_FILE = join(MEATSPACE_DIR, 'eyes.json');
-// Column indices (0-based)
+// Column indices (0-based), verified against actual TSV headers
const COL = {
DATE: 2,
// Nutrition (3-11)
@@ -30,28 +30,28 @@ const COL = {
SUGAR: 11,
// Alcohol summary
ALCOHOL_GRAMS: 12,
- // Body composition (15-20)
- WEIGHT_LBS: 15,
- WEIGHT_KG: 16,
- MUSCLE_PCT: 17,
- FAT_PCT: 18,
- BONE_MASS: 19,
- TEMPERATURE: 20,
- // Protein/Mercury columns (84-112)
- PROTEIN_START: 84,
+ // Body composition (16-21)
+ WEIGHT_LBS: 16,
+ WEIGHT_KG: 17,
+ MUSCLE_PCT: 18,
+ FAT_PCT: 19,
+ BONE_MASS: 20,
+ TEMPERATURE: 21,
+ // Protein/Mercury columns (96-112)
+ PROTEIN_START: 96,
PROTEIN_END: 112,
- // Individual beverages (113-172)
- BEVERAGE_START: 113,
- BEVERAGE_END: 172,
- // Elysium Index (173-184)
- EPIGENETIC_START: 173,
- EPIGENETIC_END: 184,
- // Blood tests (185-239)
- BLOOD_START: 185,
- BLOOD_END: 239,
- // Eye prescription (240-245)
- EYE_START: 240,
- EYE_END: 245
+ // Individual beverages (119-178) — names in row 0, ABV in row 1, serving oz in row 2
+ BEVERAGE_START: 119,
+ BEVERAGE_END: 178,
+ // Elysium Index (179-190)
+ EPIGENETIC_START: 179,
+ EPIGENETIC_END: 190,
+ // Blood tests (193-245)
+ BLOOD_START: 193,
+ BLOOD_END: 245,
+ // Eye prescription (246-251)
+ EYE_START: 246,
+ EYE_END: 251
};
// Epigenetic field names (indices relative to EPIGENETIC_START)
@@ -62,9 +62,10 @@ const EPIGENETIC_FIELDS = [
];
// Eye field names (indices relative to EYE_START)
+// TSV order: Left OD Sphere, Left Cylinder, Left Axis, Right OS Sphere, Right Cylinder, Right Axis
const EYE_FIELDS = [
- 'rightSphere', 'rightCylinder', 'rightAxis',
- 'leftSphere', 'leftCylinder', 'leftAxis'
+ 'leftSphere', 'leftCylinder', 'leftAxis',
+ 'rightSphere', 'rightCylinder', 'rightAxis'
];
// === Parsing Helpers ===
@@ -100,8 +101,9 @@ function parseBeverages(row, beverageNames, beverageABVs, beverageSizes) {
if (!count || count <= 0) continue;
const idx = i - COL.BEVERAGE_START;
- const name = beverageNames[idx] || `Beverage ${idx + 1}`;
- const abv = parseNum(beverageABVs[idx]) || 5;
+ const rawAbv = parseNum(beverageABVs[idx]) || 5;
+ const name = beverageNames[idx] || `${rawAbv}% ABV`;
+ const abv = rawAbv;
const servingOz = parseNum(beverageSizes[idx]) || 12;
const oz = servingOz * count;
@@ -151,16 +153,16 @@ function parseBloodTests(row, bloodHeaders) {
function parseEpigenetic(row) {
const result = {};
- let hasAny = false;
for (let i = 0; i < EPIGENETIC_FIELDS.length; i++) {
const val = parseNum(row[COL.EPIGENETIC_START + i]);
if (val === null) continue;
result[EPIGENETIC_FIELDS[i]] = val;
- hasAny = true;
}
- if (!hasAny) return null;
+ // Only count as a real epigenetic test if biologicalAge or paceOfAging is present
+ // (chronologicalAge alone is just the user's age, populated on every row)
+ if (result.biologicalAge == null && result.paceOfAging == null) return null;
// Separate organ scores from top-level fields
const organScores = {};
@@ -209,22 +211,25 @@ export async function importTSV(content) {
const headerRow3 = lines[2].split('\t'); // Serving sizes, reference ranges, units
// Extract beverage metadata from headers
+ // Row 0 has beverage names, Row 1 has ABV values (e.g. "5.4%"), Row 2 has serving sizes in oz
const beverageNames = [];
const beverageABVs = [];
const beverageSizes = [];
for (let i = COL.BEVERAGE_START; i <= COL.BEVERAGE_END; i++) {
const idx = i - COL.BEVERAGE_START;
- beverageNames[idx] = headerRow2[i] || '';
- // ABV typically in row 2 header, serving size in row 3
+ beverageNames[idx] = headerRow1[i] || '';
+ // ABV is in row 1 as "X.X%" format
const abvMatch = String(headerRow2[i] || '').match(/(\d+\.?\d*)%/);
- beverageABVs[idx] = abvMatch ? abvMatch[1] : headerRow3[i];
+ beverageABVs[idx] = abvMatch ? abvMatch[1] : '5';
beverageSizes[idx] = headerRow3[i] || '12';
}
- // Extract mercury values from protein source headers (row 3 has Hg mg values)
+ // Extract mercury values from protein names in row 1 (e.g. "chicken Hg: .002")
const mercuryHeaders = [];
for (let i = COL.PROTEIN_START; i <= COL.PROTEIN_END; i++) {
- mercuryHeaders[i - COL.PROTEIN_START] = headerRow3[i] || '0';
+ const name = String(headerRow2[i] || '');
+ const hgMatch = name.match(/[Hh]g:\s*([\d.]+)/);
+ mercuryHeaders[i - COL.PROTEIN_START] = hgMatch ? hgMatch[1] : '0';
}
// Extract blood test names from row 2
diff --git a/server/services/meatspaceImport.test.js b/server/services/meatspaceImport.test.js
index ec643d9bd9..d4ed2ccf6e 100644
--- a/server/services/meatspaceImport.test.js
+++ b/server/services/meatspaceImport.test.js
@@ -44,9 +44,9 @@ function buildMinimalTSV(dataRows) {
if (row.carbs != null) cells[9] = String(row.carbs);
if (row.fiber != null) cells[10] = String(row.fiber);
if (row.sugar != null) cells[11] = String(row.sugar);
- // Body
- if (row.weightLbs != null) cells[15] = String(row.weightLbs);
- if (row.weightKg != null) cells[16] = String(row.weightKg);
+ // Body (cols 16-21)
+ if (row.weightLbs != null) cells[16] = String(row.weightLbs);
+ if (row.weightKg != null) cells[17] = String(row.weightKg);
return cells.join('\t');
});