Metric | Source Field | Logic / Calculation | Trigger |
---|---|---|---|
Coherence | identityVector (array) |
Average of 4 floats × 100 → % via calculateVectorStrength() |
Every dashboard visit (reads from user record) |
Growth | growthSinceLast |
Euclidean distance vs. last session’s vectorAtEnd × 100 |
On dashboard visit, triggered in getDashboardData() |
Mood | preferredMood |
Stored directly; set via /api/dashboard/mood |
Manual update or defaults to "contemplative" |
🛠 If you want to override, mock, or tweak behavior:
- Set identityVector directly in the DB, or add a dev button to modify it.
- Simulate a last vector (e.g., [0.2, 0.2, 0.2, 0.2]) in userSessions and reload the dashboard.
- Call the mood API manually:
fetch('/api/dashboard/mood', {
method: 'POST',
body: JSON.stringify({ mood: "inspired" }),
headers: { "Content-Type": "application/json" }
});
the difference between the coherence and growth metrics?
Great question — Coherence and Growth look similar at a glance (both are % values derived from the identityVector), but they measure fundamentally different things:
💎 Coherence: How internally aligned your current state is. A compass: "How centered am I now?"
🌱 Growth: How much you’ve changed since your last session. A pedometer: "How far have I come?"
Calculated as the average of your current identity vector components.
Represents how “aligned” or “integrated” your self-state is.
Copy
Edit
const calculateVectorStrength = (vector: number[]) => {
return Math.round(
vector.reduce((sum, val) => sum + val, 0) / vector.length * 100
);
};
Compares your current vector to the one from your last saved session.
Uses Euclidean distance to calculate how much your state has changed:
Copy
Edit
const distance = Math.sqrt(
currentVector.reduce((sum, val, i) =>
sum + Math.pow(val - (lastVector[i] || 0.5), 2), 0)
);
const growthPercentage = Math.round(distance * 100);
Even if coherence stays high, you can have high growth if your vector changed significantly.
Want me to suggest a tooltip or visual metaphor in your UI to explain this distinction for users?
how is this actually measured?
Here’s exactly how Coherence and Growth are measured in your codebase — both mathematically and functionally.
You’re storing a 4-element array called identityVector in the users table of your SQLite DB (skyless.db).
This vector represents a user’s internal state across 4 dimensions (which you may have symbolically defined elsewhere).
✅ Definition:
- The mean of the 4 vector values, scaled to a percentage.
🧮 Formula in your code (client/src/pages/dashboard.tsx):
Copy
Edit
const calculateVectorStrength = (vector: number[]) => {
if (!vector) return 0;
return Math.round(vector.reduce((sum, val) => sum + val, 0) / vector.length * 100);
};
🔍 Example:
[0.7, 0.6, 0.8, 0.9] → Average = 0.75 → Coherence = 75%
✅ Definition:
- The Euclidean distance between the current vector and the last session’s vectorAtEnd, scaled to a percentage.
🧮 Formula in your code (server/storage.ts):
Copy
Edit
const distance = Math.sqrt(
currentVector.reduce((sum, val, i) =>
sum + Math.pow(val - (lastVector[i] || 0.5), 2), 0)
);
const growthPercentage = Math.round(distance * 100);
The default fallback for missing data is 0.5 (neutral midpoint).
User Action | System Behavior |
---|---|
Visit dashboard | getDashboardData() reads identityVector and last vectorAtEnd |
Create reflection | Updates identityVector in users table |
Start new session | Logs a new row in userSessions with vectorAtStart |
End session | Stores current vector as vectorAtEnd in userSessions |
Let me know if you want to:
-
Log these updates explicitly in a UI audit trail
-
Add a test button to simulate vector changes
-
Visualize the 4D vector as a radar chart or bar segments
Happy to help extend this.
"This vector represents a user’s internal state across 4 dimensions (which you may have symbolically defined elsewhere)."
elaborate
Great — let’s dive deeper.
The identityVector is a 4-element array of floats between 0 and 1, stored per user. It looks like:
identityVector: [0.6, 0.8, 0.5, 0.7]
It functions as a symbolic fingerprint of a user’s current inner state — numerically encoding qualities that evolve over time through their interactions, reflections, or choices.
Using a vector allows you to:
-
Track multi-dimensional evolution
-
Measure change (distance) and alignment (average)
-
Support future symbolic interpretation (see below)
While the code doesn’t currently name them, here are three paths forward:
You can define them as symbolic traits, each representing an axis of user orientation. For example:
Index | Name | Description |
---|---|---|
0 | Clarity | Mental resolution or focus |
1 | Depth | Reflective or introspective capacity |
2 | Energy | Emotional charge or intensity |
3 | Openness | Receptivity to new input or perspectives |
This enables downstream interpretations like:
If you leave the vector unnamed, you can let AI agents learn patterns of behavior associated with different vector shapes:
- You could later map these to archetypes, moods, or transitions (e.g. via Skyla).
Some systems generate these vectors from semantic embeddings or reflection metadata (e.g., keywords in journal entries, emojis selected, etc.) — you could evolve the vector based on those signals.
If your user’s vector shifts from [0.3, 0.3, 0.3, 0.3] → [0.8, 0.8, 0.8, 0.8], that’s high Growth and high Coherence.
If they go from [0.7, 0.2, 0.9, 0.4] → [0.6, 0.3, 0.8, 0.3], that’s small Growth, similar Coherence — maybe slight regression.
-
Name each dimension and show sliders or radial chart
-
Train Skyla or another symbolic AI to evolve the vector recursively
-
Add glyphs or mood-archetypes when certain vector patterns appear
-
Use ZK-proofs to verify user evolution without revealing full state
-
Define symbolic names for each vector dimension now?
-
Add frontend visualizations or moods tied to certain vector types?
-
Or evolve toward a fully symbolic, proof-based identity system?
-
I can help formalize the symbolic system or expand this into an interpretive UX.