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

docs: state the goals card's urgency-freshness limits precisely (#2675)

[._.]/ Adam Eivy336bbc36597c
diff --git a/client/src/components/character/GoalsCard.jsx b/client/src/components/character/GoalsCard.jsx
index eae84dbf45..ff1b94b239 100644
--- a/client/src/components/character/GoalsCard.jsx
+++ b/client/src/components/character/GoalsCard.jsx
@@ -86,15 +86,18 @@ export default function GoalsCard() {
let cancelled = false;
// The TREE endpoint, not the flat one: `urgency` is only *persisted* when a goal is
// written or a birth date is set, so `getGoals()` hands back whatever was last stored.
- // `getGoalsTree().flat` re-derives urgency from the longevity horizons the goals feature
- // maintains, and is the exact source /goals ranks by — so the sheet can never disagree
- // with the page it links to. (Enriching the flat endpoint instead would change a shared
- // API's semantics.)
+ // `getGoalsTree().flat` re-derives it, and is the same source /goals reads urgency from —
+ // so the two surfaces can never show contradictory urgency. (Enriching the flat endpoint
+ // instead would change a shared API's semantics.)
//
- // Those horizons are themselves only as fresh as the last deriveLongevity() run — every
- // consumer shares that, and re-deriving from this read-only card would both write on a
- // read path and make the sheet disagree with /goals. Tracked in PLAN.md as the goals
- // feature's own fix.
+ // Two honest limits on how fresh that is, both the goals feature's to fix (see PLAN.md),
+ // and both landing on "sorts last" rather than on a wrong number:
+ // - The tree only re-derives for goals it considers active (`goals.js` gates on a
+ // strict status), so the status-less goals `isActive` admits keep whatever urgency
+ // they carry — for MortalLoom-synced goals, none at all.
+ // - The horizons it derives against are only as fresh as the last deriveLongevity()
+ // run. Every urgency consumer shares that, and re-deriving from this read-only card
+ // would write on a read path AND make the sheet disagree with /goals.
//
// silent: this card owns its own error UI (the message below), so letting request() toast
// as well would surface the same failure twice.
diff --git a/client/src/components/character/GoalsCard.test.jsx b/client/src/components/character/GoalsCard.test.jsx
index b3968e7f81..2668e6ba93 100644
--- a/client/src/components/character/GoalsCard.test.jsx
+++ b/client/src/components/character/GoalsCard.test.jsx
@@ -158,15 +158,13 @@ describe('GoalsCard — populated', () => {
.toBeInTheDocument();
});
- it('reads goals once from the tree endpoint, silently, and never writes them back', async () => {
+ it('reads once from the tree endpoint, silently', async () => {
await renderCard([goal()]);
- // Surface, don't duplicate: a read-only mirror calls the read endpoint exactly once and
- // owns no write path at all.
+ // Surface, don't duplicate: a read-only mirror hits the read endpoint exactly once.
//
// The TREE endpoint specifically: getGoals() hands back whatever urgency was last
- // WRITTEN, which decays as yearsRemaining falls, so ranking off it would let the sheet
- // order goals differently from the /goals page it links to. Only getGoalsTree()
- // re-derives urgency from current longevity.
+ // WRITTEN, so ranking off it would let the sheet show urgency that contradicts the
+ // /goals page it links to. Only getGoalsTree() re-derives it.
expect(getGoalsTree).toHaveBeenCalledTimes(1);
// silent — the card renders its own error message, so request() must not toast it too.
expect(getGoalsTree).toHaveBeenCalledWith({ silent: true });