feat(confidence-engine): establish authenticated product boundary
This commit is contained in:
@@ -3,8 +3,9 @@ import {
|
||||
PROMPT_VERSIONS,
|
||||
DEFAULT_PROMPT_VERSION,
|
||||
} from "@/lib/analysis";
|
||||
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
||||
|
||||
export async function POST(request) {
|
||||
async function post(request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
@@ -47,3 +48,5 @@ export async function POST(request) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = withAuthenticatedApi(post);
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
|
||||
import { getProvider, getProviderModelName } from "@/lib/llm/provider.js";
|
||||
import { synthesizeInvestigationOverview } from "@/lib/graph/investigation-overview-synthesis.js";
|
||||
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
||||
|
||||
export async function POST(request) {
|
||||
async function post(request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
@@ -66,3 +67,5 @@ export async function POST(request) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = withAuthenticatedApi(post);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { startCase } from "@/lib/graph/orchestrator.js";
|
||||
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
||||
|
||||
export async function POST(request) {
|
||||
async function post(request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const result = await startCase(body);
|
||||
@@ -62,3 +63,5 @@ export async function POST(request) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = withAuthenticatedApi(post);
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
|
||||
import { getProvider, getProviderModelName } from "@/lib/llm/provider.js";
|
||||
import { synthesizeCurrentUnderstanding } from "@/lib/graph/current-understanding-synthesis.js";
|
||||
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
||||
|
||||
export async function POST(request) {
|
||||
async function post(request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
@@ -69,3 +70,5 @@ export async function POST(request) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = withAuthenticatedApi(post);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { updateCase, reconsiderCompletedEpisode } from "@/lib/graph/orchestrator
|
||||
import { applyValidatedProposal } from "@/lib/graph/apply-proposal.js";
|
||||
import { prepareCompletedEpisode } from "@/lib/graph/episode-preparation.js";
|
||||
import { updateCaseEpisodeRequestSchema } from "@/lib/graph/schema.js";
|
||||
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
||||
|
||||
function mapFailureStatus(result) {
|
||||
switch (result?.stage) {
|
||||
@@ -35,7 +36,7 @@ function buildFailureResponse(result) {
|
||||
};
|
||||
}
|
||||
|
||||
export async function POST(request) {
|
||||
async function post(request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const isEpisodeMode = body?.episodeMode === true;
|
||||
@@ -89,6 +90,8 @@ export async function POST(request) {
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = withAuthenticatedApi(post);
|
||||
|
||||
/** Server-side completed-episode reconsideration flow. */
|
||||
async function handleEpisodeMode(situationGraph, body) {
|
||||
const prepared = prepareCompletedEpisode({
|
||||
|
||||
@@ -4,8 +4,9 @@ import {
|
||||
focusedDeconstructJsonSchema,
|
||||
validateFocusedDeconstructSchema,
|
||||
} from "@/lib/graph/focused-investigation";
|
||||
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
||||
|
||||
export async function POST(request) {
|
||||
async function post(request) {
|
||||
let targetNodeId = null;
|
||||
let startedAt = null;
|
||||
try {
|
||||
@@ -152,3 +153,5 @@ export async function POST(request) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = withAuthenticatedApi(post);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { formulateQuestionForTarget } from "@/lib/graph/focused-investigation";
|
||||
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
||||
|
||||
export async function POST(request) {
|
||||
async function post(request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
@@ -50,3 +51,5 @@ export async function POST(request) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = withAuthenticatedApi(post);
|
||||
|
||||
Reference in New Issue
Block a user