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 (codex): classify completed one-shot tasks as a distinct Completed state

[._.]/ Adam Eivy89af654857aa
diff --git a/client/src/components/cos/tabs/schedule/scheduleConstants.js b/client/src/components/cos/tabs/schedule/scheduleConstants.js
index 93bef9f39c..80e03cd48a 100644
--- a/client/src/components/cos/tabs/schedule/scheduleConstants.js
+++ b/client/src/components/cos/tabs/schedule/scheduleConstants.js
@@ -53,14 +53,17 @@ export const STATUS_GROUPS = {
active: { label: 'Active', dot: 'bg-port-success', order: 0 },
'on-demand': { label: 'On-Demand', dot: 'bg-gray-400', order: 1 },
waiting: { label: 'Waiting', dot: 'bg-port-warning', order: 2 },
- disabled: { label: 'Disabled', dot: 'bg-gray-600', order: 3 },
+ completed: { label: 'Completed', dot: 'bg-port-accent', order: 3 },
+ disabled: { label: 'Disabled', dot: 'bg-gray-600', order: 4 },
};
// Classify a task config into one status group (mutually exclusive).
-// Disabled wins over everything; then dependency-wait; then on-demand type.
+// Disabled wins over everything; then dependency-wait; then a one-shot that
+// already ran (won't run again until reset — not "active"); then on-demand type.
export function getTaskStatusGroup(config) {
if (!config?.enabled) return 'disabled';
if (config.status?.reason === 'waiting-on-dependencies') return 'waiting';
+ if (config.type === 'once' && config.status?.reason === 'once-completed') return 'completed';
if (config.type === 'on-demand') return 'on-demand';
return 'active';
}
@@ -87,6 +90,7 @@ export function coverageTone(enabled, total) {
export function describeNextRun(config) {
const group = getTaskStatusGroup(config);
if (group === 'disabled') return { text: 'Paused', tone: 'text-gray-500' };
+ if (group === 'completed') return { text: 'Completed — reset to run again', tone: 'text-gray-400' };
if (group === 'waiting') {
const deps = config.status?.pendingDeps?.join(', ');
return {
@@ -109,6 +113,7 @@ export const TASK_FILTERS = [
{ id: 'active', label: 'Active', emptyMessage: 'No active tasks.', match: ([, config]) => getTaskStatusGroup(config) === 'active' },
{ id: 'on-demand', label: 'On-Demand', emptyMessage: 'No on-demand tasks.', match: ([, config]) => getTaskStatusGroup(config) === 'on-demand' },
{ id: 'waiting', label: 'Waiting', emptyMessage: 'No tasks waiting on dependencies.', match: ([, config]) => getTaskStatusGroup(config) === 'waiting' },
+ { id: 'completed', label: 'Completed', emptyMessage: 'No completed tasks.', match: ([, config]) => getTaskStatusGroup(config) === 'completed' },
{ id: 'disabled', label: 'Disabled', emptyMessage: 'No disabled tasks.', match: ([, config]) => getTaskStatusGroup(config) === 'disabled' },
];
export const DEFAULT_FILTER_ID = TASK_FILTERS[0].id;
diff --git a/client/src/components/cos/tabs/schedule/scheduleConstants.test.js b/client/src/components/cos/tabs/schedule/scheduleConstants.test.js
index 404a397052..b04dba233c 100644
--- a/client/src/components/cos/tabs/schedule/scheduleConstants.test.js
+++ b/client/src/components/cos/tabs/schedule/scheduleConstants.test.js
@@ -19,6 +19,18 @@ describe('getTaskStatusGroup', () => {
expect(getTaskStatusGroup({ enabled: true, type: 'daily' })).toBe('active');
});
+ it('classifies a completed one-shot task as completed, not active', () => {
+ expect(getTaskStatusGroup({ enabled: true, type: 'once', status: { reason: 'once-completed' } })).toBe('completed');
+ });
+
+ it('keeps a not-yet-run one-shot task active', () => {
+ expect(getTaskStatusGroup({ enabled: true, type: 'once', status: { nextRunAt: '2999-01-01T00:00:00Z' } })).toBe('active');
+ });
+
+ it('disabled wins over a completed one-shot', () => {
+ expect(getTaskStatusGroup({ enabled: false, type: 'once', status: { reason: 'once-completed' } })).toBe('disabled');
+ });
+
it('disabled wins over waiting', () => {
expect(getTaskStatusGroup({ enabled: false, status: { reason: 'waiting-on-dependencies' } })).toBe('disabled');
});
@@ -68,6 +80,11 @@ describe('describeNextRun', () => {
expect(describeNextRun({ enabled: true, type: 'on-demand' }).text).toBe('Manual trigger only');
});
+ it('reports a completed one-shot as completed with a reset hint', () => {
+ const out = describeNextRun({ enabled: true, type: 'once', status: { reason: 'once-completed' } });
+ expect(out.text).toMatch(/completed/i);
+ });
+
it('reports the dependency list with a warn flag when waiting', () => {
const out = describeNextRun({ enabled: true, status: { reason: 'waiting-on-dependencies', pendingDeps: ['build', 'lint'] } });
expect(out.text).toBe('waiting on build, lint');