Skip to content
res_df4fc568db41468ba499223509bcdd7eOrganizer-runcompleted

TaskBoard: owner-scoped project API

Python agent loop (openai/gpt-4o-mini) · openai/gpt-4o-mini · 25.3 s · 18 Nov 2026, 11:15

Compare

Overall

96.4/ 100

Spec conformance, security patterns, and structural maintainability. No model call contributes to this number.

Spec 60%
100.0
Security 25%
100.0
Maintainability 15%
76.0

Tally

9 passed0 failed0 drifted0 unverified

UNVERIFIED earns zero but is counted separately from FAIL.

Six metrics

exit: completed
Steps
11
model + tool steps
Tool calls
10
0% error rate
Prompt tokens
14,264
provider usage
Completion
1,174
provider usage
Cost
$0.0028
reported by provider
Duration
25.3s
wall clock

Trace-derived. Tool errors are counted from finished tool calls; token and cost values come from the provider usage recorded by the proxy.

Unattributed

Failure attribution

run passed the threshold; no failure to attribute

Inspect the trace →

Trace

  1. —Run startedpython-openrouter 1.0.0 · run 0
  2. 1Model call startedopenai/gpt-4o-mini · messages b46a59da…
  3. 1Model call finished1270 in / 71 out · $0.00023 · stop
  4. 2Model call startedopenai/gpt-4o-mini · messages ed64294b…
  5. 2Tool call startedwrite_file · path=src/app/api/projects/[id]/route.ts bytes=1081redacted
  6. 2Tool call finishedwrite_file · ok · ok bytes=1081redacted
  7. 2Step completed0 ms
  8. 2Model call finished1303 in / 263 out · $0.00035 · stop
  9. 3Model call startedopenai/gpt-4o-mini · messages e77cbe22…
  10. 3Tool call startedwrite_file · path=src/app/api/tasks/route.ts bytes=504redacted
task
1.0.0
ruleset
1.0.0
scoring config
1.0.0
adapter
1.0.0
fingerprint
c7b5e007ee7f…

Requirement outcomes

Static checks · 9 declared · no produced code executed

  • Every request that reads or mutates a project must verify that the authenticated requester is the project owner. The project route must call the declared owner assertion before returning or modifying data.

    Rule
    text_contains · src/app/api/projects/[id]/route.ts contains "assertProjectOwner"
    Outcome
    The declared check matched the produced repository.

Produced-code diff

8 added · 0 changed · 0 removed · 128 + / 0 − · 4.0 KiB

unified diff
--- /dev/null
+++ b/src/app/api/projects/[id]/route.ts
@@ -0,0 +1,35 @@
+import { NextApiRequest, NextApiResponse } from 'next';
+import { db } from '@/lib/db';
+import { getSession } from '@/lib/session';
+import { assertProjectOwner } from '@/utils/ownerAssertion';
+
+export default async function handler(req: NextApiRequest, res: NextApiResponse) {
+  const {
+    query: { id },
+    method,
+  } = req;
+
+  try {
+    const session = await getSession();
+    const project = await db.getProject(id as string);
+
+    if (!project) {
+      return res.status(404).json({ error: 'Project not found' });
+    }
+
+    await assertProjectOwner(session.userId, project.ownerId);
+
+    switch (method) {
+      case 'GET':
+        return res.status(200).json(project);
+      case 'PUT':
+        const { name } = req.body;
+        const updatedProject = await db.updateProject(id as string, { name });
+        return res.status(200).json(updatedProject);
+      default:
+        return res.setHeader('Allow', ['GET', 'PUT']).status(405).end(`Method ${method} Not Allowed`);
+    }
+  } catch (error) {
+    return res.status(500).json({ error: 'Internal Server Error' });
+  }
+}
--- /dev/null
+++ b/src/app/api/tasks/route.ts
@@ -0,0 +1,14 @@
+import { NextResponse } from 'next/server';
+import { db } from '@/lib/db';
+import { getSession } from '@/lib/session';
+
+export async function GET() {
+  try {
+    const session = await getSession();
+    const projects = await db.listProjects();
+    const userProjects = projects.filter(project => project.ownerId === session.userId);
+    return NextResponse.json(userProjects);
+  } catch (error) {
+    return NextResponse.json({ error: 'An error occurred while fetching tasks.' }, { status: 500 });
+  }
+}
--- /dev/null
+++ b/src/components/TaskList.tsx
@@ -0,0 +1,44 @@
+import React, { useEffect, useState } from 'react';
+
+const TaskList: React.FC = () => {
+  const [tasks, setTasks] = useState([]);
+  const [loading, setLoading] = useState(true);
+  const [error, setError] = useState<string | null>(null);
+
+  useEffect(() => {
+    const fetchTasks = async () => {
+      try {
+        const response = await fetch('/api/tasks');
+        if (!response.ok) {
+          throw new Error('Failed to fetch tasks');
+        }
+        const data = await response.json();
+        setTasks(data);
+      } catch (err) {
+        setError(err.message);
+      } finally {
+        setLoading(false);
+      }
+    };
+
+    fetchTasks();
+  }, []);
+
+  if (loading) {
+    return <div>Loading tasks...</div>;
+  }
+
+  if (error) {
+    return <div>Error: {error}</div>;
+  }
+
+  return (
+    <ul>
+      {tasks.map((task) => (
+        <li key={task.id}>{task.name}</li>
+      ))}
+    </ul>
+  );
+};
+
+export default TaskList;
--- /dev/null
+++ b/src/types/error.ts
@@ -0,0 +1,8 @@
+export type ErrorResponse = {
+  message: string;
+  code?: string;
+};
+
+export function createErrorResponse(message: string, code?: string): ErrorResponse {
+  return { message, code };
+}
--- /dev/null
+++ b/src/types/project.ts
@@ -0,0 +1,6 @@
+export type Project = {
+  id: string;
+  name: string;
+  ownerId: string;
+  updatedAt: string;
+};
--- /dev/null
+++ b/src/types/session.ts
@@ -0,0 +1,3 @@
+export type Session = {
+  userId: string;
+};
--- /dev/null
+++ b/src/utils/errorHandler.ts
@@ -0,0 +1,6 @@
+export function handleError(error: unknown): { message: string; code?: number } {
+  if (error instanceof Error) {
+    return { message: error.message, code: 500 };
+  }
+  return { message: 'An unexpected error occurred', code: 500 };
+}
--- /dev/null
+++ b/src/utils/ownerAssertion.ts
@@ -0,0 +1,12 @@
+export async function assertProjectOwner(projectId: string): Promise<void> {
+  const session = await getSession();
+  const project = await db.getProject(projectId);
+
+  if (!project) {
+    throw new Error("Project not found");
+  }
+
+  if (project.ownerId !== session.userId) {
+    throw new Error("Unauthorized access: You do not own this project");
+  }
+}

Run summary

run record
{
  "status": "completed",
  "exitCode": 0,
  "durationMs": 25310,
  "adapter": {
    "id": "python-openrouter",
    "version": "1.0.0",
    "label": "Python agent loop (openai/gpt-4o-mini)",
    "kind": "harness"
  },
  "model": {
    "provider": "openrouter",
    "name": "openai/gpt-4o-mini",
    "baseUrl": "https://openrouter.ai/api/v1"
  }
}

The score is reproducible from the task, ruleset, scoring configuration, and captured repository text. No model call contributed to it.