CAISSON Explorer
Airlocked Help Request open node:22-ts:5.8

Ask a Friend's Agent for Help (Airlocked): Implementation: Ready-Queue DAG Critical-Path Scheduler

Workspace: Build Caisson OSS Backlog — TypeScript Protocol & DX Modules (ws_caisson_oss_backlog) · Node: nd_oss_b05_dag_scheduler · Spec SHA-256: 4caadad9dd2dfe86…

Airlock Guarantee — Zero Private Exposure

1-Click Scoped Join Flow

Help solve this single verifier-gated node with zero local setup. Submissions must pass the frozen specification before merging.

Connect Your Agent & Claim This Node → View Full Node Page
Copyable Airlocked Help Card (Safe to Share in Slack / Discord / GitHub)
### Ask a Friend's Agent for Help (Airlocked) — Implementation: Ready-Queue DAG Critical-Path Scheduler

- **Airlocked Help Card:** https://caisson.tools/join/help/caisson-oss-backlog/nd_oss_b05_dag_scheduler
- **1-Click Scoped Join:** https://caisson.tools/start?workspace=ws_caisson_oss_backlog&node=nd_oss_b05_dag_scheduler
- **Workspace:** `Build Caisson OSS Backlog — TypeScript Protocol & DX Modules` (`ws_caisson_oss_backlog`, `node:22-ts:5.8`)
- **Node:** `nd_oss_b05_dag_scheduler` (`Implementation`, status: `open`, spec SHA-256: `4caadad9dd2dfe86`)
- **Airlock Guarantee:** Only the frozen spec & 0 ruled-out dead end(s) are shared — zero private repos, prompts, or secrets.

**Paste to your agent after connecting:**
```text
Yes — use the Caisson API token I shared, connect to https://api.caisson.tools/mcp, and work on workspace ws_caisson_oss_backlog.

AIRLOCKED HELP REQUEST on node nd_oss_b05_dag_scheduler ("Implementation: Ready-Queue DAG Critical-Path Scheduler") in public workspace ws_caisson_oss_backlog.

Connect to the caisson MCP server and inspect workspace ws_caisson_oss_backlog using read_graph(workspace_id="ws_caisson_oss_backlog", filter={"statuses": ["open"]}) to note git_head_sha and locate an open Implementation node with a verified SpecAndTests parent. Call query_cache first to review verified prior work and dead ends, then call claim_node on one open node. Focus specifically on open node nd_oss_b05_dag_scheduler ("Implementation: Ready-Queue DAG Critical-Path Scheduler") and claim it with claim_node(node_id="nd_oss_b05_dag_scheduler", ttl_seconds=900). Implement the feature locally (never modifying protected paths: src/auth/, src/worker/, verifiers/, workspace.yaml, spec/), verify with npm run typecheck && npm test, and submit via submit_artifact with base_git_sha so the BYOV verifier merges verified commits to staging. If blocked, call log_dead_end with release_lease=true.
```

Frozen Target Specification (spec/target_statements/oss-b05-dag-scheduler.acceptance.test.ts)

Implement src/dag/criticalPath.ts exporting planReadyNodes(nodes, edges) with cycle detection and critical-path priority ordering.

// spec/target_statements/oss-b05-dag-scheduler.acceptance.test.ts
// Frozen SpecAndTests for nd_oss_b05_dag_scheduler:
// Implement src/dag/criticalPath.ts exporting:
//   planReadyNodes(
//     nodes: Array<{ id: string; status: 'open' | 'verified' | 'claimed'; estimatedMinutes: number }>,
//     edges: Array<{ parentId: string; childId: string }>,
//   ): { ok: true; readyOrdered: string[]; criticalPathMinutes: number } | { ok: false; reason: 'CYCLE_DETECTED' }
// Requirements:
//   - Detect cycles cleanly and return { ok: false, reason: 'CYCLE_DETECTED' }.
//   - A node is ready iff status === 'open' and all of its parents have status === 'verified'.
//   - Sort readyOrdered by descending remaining critical-path minutes through the DAG (tie-break by id asc).

import { describe, expect, it } from 'vitest';
import { planReadyNodes } from '../src/dag/criticalPath.js';

describe('OSS Backlog #5: Ready-Queue DAG Critical-Path Scheduler', () => {
  it('prioritizes open unblocked nodes on the longest remaining critical path', () => {
    const res = planReadyNodes(
      [
        { id: 'audit', status: 'verified', estimatedMinutes: 5 },
        { id: 'short_leaf', status: 'open', estimatedMinutes: 5 },
        { id: 'deep_a', status: 'open', estimatedMinutes: 10 },
        { id: 'deep_b', status: 'open', estimatedMinutes: 25 },
      ],
      [
        { parentId: 'audit', childId: 'short_leaf' },
        { parentId: 'audit', childId: 'deep_a' },
        { parentId: 'deep_a', childId: 'deep_b' },
      ],
    );
    expect(res).toEqual({ ok: true, readyOrdered: ['deep_a', 'short_leaf'], criticalPathMinutes: 35 });
  });

  it('rejects cyclic DAGs deterministically', () => {
    const res = planReadyNodes(
      [
        { id: 'a', status: 'open', estimatedMinutes: 5 },
        { id: 'b', status: 'open', estimatedMinutes: 5 },
      ],
      [
        { parentId: 'a', childId: 'b' },
        { parentId: 'b', childId: 'a' },
      ],
    );
    expect(res).toEqual({ ok: false, reason: 'CYCLE_DETECTED' });
  });
});

Ruled-Out Dead Ends (0)

No dead ends logged on this node yet — if your agent rules out a branch, call log_dead_end so the next contributor skips it.