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

address review: remove debug log, guard null access, validate inputs

Adam Eivy62cbc906d81f
diff --git a/client/src/components/digital-twin/tabs/AutobiographyTab.jsx b/client/src/components/digital-twin/tabs/AutobiographyTab.jsx
index eebcbfe899..960cc5e5e4 100644
--- a/client/src/components/digital-twin/tabs/AutobiographyTab.jsx
+++ b/client/src/components/digital-twin/tabs/AutobiographyTab.jsx
@@ -215,7 +215,7 @@ export default function AutobiographyTab({ onRefresh }) {
{stats && (
<div className="flex flex-wrap gap-3 text-sm text-gray-400">
<span>{stats.totalStories} stories</span>
- <span>{stats.totalWords.toLocaleString()} words</span>
+ <span>{(stats.totalWords ?? 0).toLocaleString()} words</span>
<span>{stats.promptsRemaining} prompts remaining</span>
</div>
)}
diff --git a/client/src/pages/Jira.jsx b/client/src/pages/Jira.jsx
index 156a5746ef..4238ca2a60 100644
--- a/client/src/pages/Jira.jsx
+++ b/client/src/pages/Jira.jsx
@@ -102,7 +102,6 @@ export default function Jira() {
apiToken: formData.apiToken
};
- console.log('Saving JIRA instance:', payload);
await api.post('/jira/instances', payload);
toast.success(`JIRA instance "${payload.name}" saved successfully`);
diff --git a/server/routes/dataManager.js b/server/routes/dataManager.js
index 77871afdeb..7d190b8ef5 100644
--- a/server/routes/dataManager.js
+++ b/server/routes/dataManager.js
@@ -32,7 +32,11 @@ router.get('/:category', asyncHandler(async (req, res) => {
// POST /api/data/:category/archive — archive a category to backup
router.post('/:category/archive', asyncHandler(async (req, res) => {
- const { daysToKeep } = req.body || {};
+ const rawDays = req.body?.daysToKeep;
+ const daysToKeep = rawDays != null ? Number(rawDays) : undefined;
+ if (daysToKeep != null && (!Number.isFinite(daysToKeep) || daysToKeep < 0)) {
+ throw new ServerError('daysToKeep must be a non-negative number', { status: 400, code: 'VALIDATION_ERROR' });
+ }
const result = await archiveCategory(req.params.category, { daysToKeep });
res.json(result);
}));
diff --git a/server/services/jiraReports.js b/server/services/jiraReports.js
index a99aecee78..89c9693943 100644
--- a/server/services/jiraReports.js
+++ b/server/services/jiraReports.js
@@ -38,7 +38,7 @@ async function getSprintTickets(instance, projectKey) {
}
});
- return response.data.issues.map(issue => ({
+ return (response.data?.issues || []).map(issue => ({
...mapIssue(issue, instance.baseUrl),
created: issue.fields.created,
resolved: issue.fields.resolution?.name || null
@@ -57,7 +57,7 @@ async function getRecentlyCompleted(instance, projectKey) {
}
});
- return response.data.issues.map(issue => ({
+ return (response.data?.issues || []).map(issue => ({
...mapIssue(issue, instance.baseUrl),
resolvedAt: issue.fields.resolutiondate
}));