diff --git a/apps/arc-web/app/data/verifications.ts b/apps/arc-web/app/data/verifications.ts index 8419c061d..40aeb1bc4 100644 --- a/apps/arc-web/app/data/verifications.ts +++ b/apps/arc-web/app/data/verifications.ts @@ -1,4 +1,4 @@ -export type VerificationStatus = "pass" | "fail" | "na"; +export type VerificationResult = "pass" | "fail" | "skip" | "na"; export type VerificationType = "ai" | "automated" | "analysis" | "ai-analysis"; @@ -6,13 +6,13 @@ export interface Criterion { name: string; description: string; type: VerificationType | null; - status: VerificationStatus; + status: VerificationResult; } export interface VerificationCategory { name: string; question: string; - status: VerificationStatus; + status: VerificationResult; criteria: Criterion[]; } @@ -31,6 +31,13 @@ export const statusConfig = { dot: "bg-coral", border: "border-l-coral/50", }, + skip: { + label: "Skip", + color: "text-fg-muted", + bg: "bg-overlay", + dot: "bg-fg-muted", + border: "border-l-fg-muted/50", + }, na: { label: "N/A", color: "text-fg-muted", @@ -39,7 +46,7 @@ export const statusConfig = { border: "border-l-fg-muted/50", }, } as const satisfies Record< - VerificationStatus, + VerificationResult, { label: string; color: string; bg: string; dot: string; border: string } >; @@ -53,15 +60,13 @@ export const typeConfig = { { label: string; color: string; bg: string } >; -export type EvaluationResult = "pass" | "fail" | "skip"; - export type VerificationMode = "active" | "evaluate" | "disabled"; export interface CriterionPerformance { f1: number | null; passAt1: number | null; mode: VerificationMode; - evaluations: EvaluationResult[]; + evaluations: VerificationResult[]; } export const modeConfig = { diff --git a/apps/arc-web/app/routes/run-verifications.tsx b/apps/arc-web/app/routes/run-verifications.tsx index c7e8c9b19..734b888cc 100644 --- a/apps/arc-web/app/routes/run-verifications.tsx +++ b/apps/arc-web/app/routes/run-verifications.tsx @@ -15,7 +15,7 @@ import { getCriteriaSummary, } from "../data/verifications"; import type { - VerificationStatus, + VerificationResult, VerificationType, VerificationCategory, } from "../data/verifications"; @@ -28,12 +28,12 @@ export async function loader({ request, params }: Route.LoaderArgs) { const categories: VerificationCategory[] = apiCategories.map((cat) => ({ name: cat.name, question: cat.question, - status: cat.status as VerificationStatus, + status: cat.status as VerificationResult, criteria: cat.controls.map((c) => ({ name: c.name, description: c.description, type: (c.type ?? null) as VerificationType | null, - status: c.status as VerificationStatus, + status: c.status as VerificationResult, })), })); return { categories }; @@ -43,7 +43,7 @@ function StatusIcon({ status, className = "size-5", }: { - status: VerificationStatus; + status: VerificationResult; className?: string; }) { switch (status) { diff --git a/apps/arc-web/app/routes/verification-detail.tsx b/apps/arc-web/app/routes/verification-detail.tsx index 0c74f28e4..976d030ef 100644 --- a/apps/arc-web/app/routes/verification-detail.tsx +++ b/apps/arc-web/app/routes/verification-detail.tsx @@ -52,8 +52,7 @@ import { import type { VerificationType, VerificationMode, - EvaluationResult, - VerificationStatus, + VerificationResult, } from "../data/verifications"; import { apiJson } from "../api-client"; import { timeAgo } from "../lib/time"; @@ -153,7 +152,7 @@ function StatCard({ label, value, warn }: { label: string; value: string; warn?: ); } -function EvaluationBar({ evaluations }: { evaluations: readonly EvaluationResult[] }) { +function EvaluationBar({ evaluations }: { evaluations: readonly VerificationResult[] }) { if (evaluations.length === 0) { return

No evaluations yet

; } @@ -198,7 +197,7 @@ function EvaluationBar({ evaluations }: { evaluations: readonly EvaluationResult ); } -function ResultIcon({ result }: { result: VerificationStatus }) { +function ResultIcon({ result }: { result: VerificationResult }) { const config = statusConfig[result]; if (result === "pass") return ; if (result === "fail") return ; @@ -219,10 +218,10 @@ export default function VerificationDetail({ loaderData }: Route.ComponentProps) f1: apiPerf.f1 ?? null, passAt1: apiPerf.pass_at_1 ?? null, mode: apiPerf.mode as VerificationMode, - evaluations: apiPerf.evaluations as EvaluationResult[], + evaluations: apiPerf.evaluations as VerificationResult[], }; const detail = apiDetail ? { - description: apiDetail.description, + description: apiDetail.rationale, checks: apiDetail.checks, passExample: apiDetail.pass_example, failExample: apiDetail.fail_example, @@ -231,7 +230,7 @@ export default function VerificationDetail({ loaderData }: Route.ComponentProps) runId: r.run.id, runTitle: r.run.title, workflow: r.workflow.slug, - result: r.result as VerificationStatus, + result: r.result as VerificationResult, timestamp: r.timestamp, })); const siblings = apiSiblings.map((s) => ({ diff --git a/apps/arc-web/app/routes/verifications.tsx b/apps/arc-web/app/routes/verifications.tsx index e205c1071..0fb2279ea 100644 --- a/apps/arc-web/app/routes/verifications.tsx +++ b/apps/arc-web/app/routes/verifications.tsx @@ -58,7 +58,7 @@ import { import type { VerificationType, VerificationMode, - EvaluationResult, + VerificationResult, VerificationCategory, CriterionPerformance, } from "../data/verifications"; @@ -87,7 +87,7 @@ export async function loader({ request }: Route.LoaderArgs) { f1: ctrl.f1 ?? null, passAt1: ctrl.pass_at_1 ?? null, mode: (ctrl.mode ?? "disabled") as VerificationMode, - evaluations: (ctrl.evaluations ?? []) as EvaluationResult[], + evaluations: (ctrl.evaluations ?? []) as VerificationResult[], }; } } @@ -276,7 +276,7 @@ function ModeBadge({ mode }: { mode: VerificationMode }) { ); } -function EvaluationDots({ evaluations }: { evaluations: readonly EvaluationResult[] }) { +function EvaluationDots({ evaluations }: { evaluations: readonly VerificationResult[] }) { if (evaluations.length === 0) { return —; } diff --git a/crates/arc-api/src/demo/mod.rs b/crates/arc-api/src/demo/mod.rs index 664bc044b..5afb6e857 100644 --- a/crates/arc-api/src/demo/mod.rs +++ b/crates/arc-api/src/demo/mod.rs @@ -11,7 +11,7 @@ use axum::Json; use crate::error::ApiError; use crate::jwt_auth::AuthenticatedService; -use crate::server::{AppState, ListResponse, PaginationParams}; +use crate::server::{AppState, PaginationParams}; fn paginated_response(items: Vec, pagination: &PaginationParams) -> Response { let limit = pagination.limit.clamp(1, 100) as usize; @@ -22,10 +22,6 @@ fn paginated_response(items: Vec, pagination: &Paginatio (StatusCode::OK, Json(json!({ "data": data, "meta": { "has_more": has_more } }))).into_response() } -fn list_response(items: T) -> Response { - (StatusCode::OK, Json(ListResponse::new(items))).into_response() -} - // ── Runs ─────────────────────────────────────────────────────────────── pub async fn list_runs( @@ -460,8 +456,9 @@ pub async fn trigger_workflow_run_stub( pub async fn list_verifications( _auth: AuthenticatedService, State(_state): State>, + Query(pagination): Query, ) -> Response { - list_response(verifications::categories()) + paginated_response(verifications::categories(), &pagination) } pub async fn get_verification_detail( @@ -600,6 +597,17 @@ pub async fn save_query_stub( .into_response() } +pub async fn get_saved_query( + _auth: AuthenticatedService, + State(_state): State>, + Path(id): Path, +) -> Response { + match insights::saved_queries().into_iter().find(|q| q.id == id) { + Some(query) => (StatusCode::OK, Json(query)).into_response(), + None => ApiError::not_found("Saved query not found.").into_response(), + } +} + pub async fn update_query_stub( _auth: AuthenticatedService, State(_state): State>, @@ -1450,9 +1458,9 @@ mod verifications { mode: VerificationMode, f1: Option, pass_at_1: Option, - evaluations: &'static [EvaluationResult], + evaluations: &'static [VerificationResult], // Run-level status - run_status: VerificationStatus, + run_status: VerificationResult, // Detail fields detail_description: &'static str, checks: &'static [&'static str], @@ -1466,7 +1474,7 @@ mod verifications { run_id: &'static str, run_title: &'static str, workflow: &'static str, - result: VerificationStatus, + result: VerificationResult, timestamp: &'static str, } @@ -1475,35 +1483,35 @@ mod verifications { run_id: "run-047", run_title: "PR #312 \u{2014} Add OAuth2 PKCE flow", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-15T12:00:00Z", }, RecentResultDef { run_id: "run-046", run_title: "PR #311 \u{2014} Update rate limiter config", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-15T09:00:00Z", }, RecentResultDef { run_id: "run-044", run_title: "PR #309 \u{2014} Migrate to pnpm", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-14T14:00:00Z", }, RecentResultDef { run_id: "run-042", run_title: "PR #307 \u{2014} Fix session timeout", workflow: "fix_build", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-13T14:00:00Z", }, RecentResultDef { run_id: "run-040", run_title: "PR #305 \u{2014} Add webhook retries", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-12T14:00:00Z", }, ]; @@ -1513,35 +1521,35 @@ mod verifications { run_id: "run-047", run_title: "PR #312 \u{2014} Add OAuth2 PKCE flow", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-15T12:00:00Z", }, RecentResultDef { run_id: "run-046", run_title: "PR #311 \u{2014} Update rate limiter config", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-15T09:00:00Z", }, RecentResultDef { run_id: "run-044", run_title: "PR #309 \u{2014} Migrate to pnpm", workflow: "code_review", - result: VerificationStatus::Fail, + result: VerificationResult::Fail, timestamp: "2025-09-14T14:00:00Z", }, RecentResultDef { run_id: "run-042", run_title: "PR #307 \u{2014} Fix session timeout", workflow: "fix_build", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-13T14:00:00Z", }, RecentResultDef { run_id: "run-040", run_title: "PR #305 \u{2014} Add webhook retries", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-12T14:00:00Z", }, ]; @@ -1551,35 +1559,35 @@ mod verifications { run_id: "run-047", run_title: "PR #312 \u{2014} Add OAuth2 PKCE flow", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-15T12:00:00Z", }, RecentResultDef { run_id: "run-046", run_title: "PR #311 \u{2014} Update rate limiter config", workflow: "code_review", - result: VerificationStatus::Fail, + result: VerificationResult::Fail, timestamp: "2025-09-15T09:00:00Z", }, RecentResultDef { run_id: "run-044", run_title: "PR #309 \u{2014} Migrate to pnpm", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-14T14:00:00Z", }, RecentResultDef { run_id: "run-042", run_title: "PR #307 \u{2014} Fix session timeout", workflow: "fix_build", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-13T14:00:00Z", }, RecentResultDef { run_id: "run-040", run_title: "PR #305 \u{2014} Add webhook retries", workflow: "code_review", - result: VerificationStatus::Fail, + result: VerificationResult::Fail, timestamp: "2025-09-12T14:00:00Z", }, ]; @@ -1589,40 +1597,40 @@ mod verifications { run_id: "run-047", run_title: "PR #312 \u{2014} Add OAuth2 PKCE flow", workflow: "code_review", - result: VerificationStatus::Fail, + result: VerificationResult::Fail, timestamp: "2025-09-15T12:00:00Z", }, RecentResultDef { run_id: "run-046", run_title: "PR #311 \u{2014} Update rate limiter config", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-15T09:00:00Z", }, RecentResultDef { run_id: "run-044", run_title: "PR #309 \u{2014} Migrate to pnpm", workflow: "code_review", - result: VerificationStatus::Fail, + result: VerificationResult::Fail, timestamp: "2025-09-14T14:00:00Z", }, RecentResultDef { run_id: "run-042", run_title: "PR #307 \u{2014} Fix session timeout", workflow: "fix_build", - result: VerificationStatus::Fail, + result: VerificationResult::Fail, timestamp: "2025-09-13T14:00:00Z", }, RecentResultDef { run_id: "run-040", run_title: "PR #305 \u{2014} Add webhook retries", workflow: "code_review", - result: VerificationStatus::Pass, + result: VerificationResult::Pass, timestamp: "2025-09-12T14:00:00Z", }, ]; - use EvaluationResult::{Fail as F, Pass as P}; + use VerificationResult::{Fail as F, Pass as P}; const ALL_CATEGORIES: &[CategoryDef] = &[ CategoryDef { @@ -1635,7 +1643,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Active, f1: Some(0.87), pass_at_1: Some(0.82), evaluations: &[P, P, F, P, P, P, P, F, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Verifies that every change traces back to a clear origin \u{2014} whether a ticket, RFC, customer request, or incident. Without documented motivation, reviewers lack context for evaluating whether the change is appropriate.", checks: &["PR body or linked issue explains why the change is needed", "Commit messages reference a ticket or context", "No orphaned changes without traceable origin"], pass_example: "PR links to JIRA-1234 and explains the user-facing pain point being resolved.", @@ -1648,7 +1656,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Active, f1: Some(0.83), pass_at_1: Some(0.78), evaluations: &[P, F, P, P, P, F, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Checks that functional and non-functional requirements are written down before implementation begins. Specifications prevent scope creep and ensure everyone agrees on what done looks like.", checks: &["Acceptance criteria listed in the issue or PR", "Edge cases documented", "Non-functional requirements (performance, security) stated when relevant"], pass_example: "Issue includes acceptance criteria with three testable scenarios.", @@ -1661,7 +1669,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Active, f1: Some(0.79), pass_at_1: Some(0.74), evaluations: &[P, P, P, F, P, P, F, P, P, F], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Ensures developer-facing and user-facing documentation is added or updated alongside code changes. Stale docs degrade team velocity and increase onboarding cost.", checks: &["README or docs updated for new features", "API documentation reflects endpoint changes", "Inline comments for non-obvious logic"], pass_example: "New API endpoint has corresponding OpenAPI spec update and usage example in docs.", @@ -1674,7 +1682,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Evaluate, f1: Some(0.72), pass_at_1: Some(0.68), evaluations: &[P, F, P, F, P, P, F, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Flags extraneous changes that inflate the diff \u{2014} formatting-only edits, unrelated refactors, or drive-by fixes. Keeping PRs focused improves review quality and reduces revert risk.", checks: &["No unrelated formatting or whitespace changes", "Refactors separated from feature work", "Each commit addresses a single concern"], pass_example: "PR touches only files directly related to the new caching layer.", @@ -1693,7 +1701,7 @@ mod verifications { type_: Some(VerificationType::Automated), mode: VerificationMode::Active, f1: Some(0.99), pass_at_1: Some(0.98), evaluations: &[P, P, P, P, P, P, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Validates that code layout conforms to the project's formatting standard (e.g., Prettier, rustfmt). Automated formatting removes subjective style debates from code review.", checks: &["All files pass the project formatter", "No manual formatting overrides without justification"], pass_example: "All changed files pass `prettier --check` and `rustfmt --check`.", @@ -1706,7 +1714,7 @@ mod verifications { type_: Some(VerificationType::Automated), mode: VerificationMode::Active, f1: Some(0.98), pass_at_1: Some(0.97), evaluations: &[P, P, P, P, P, P, P, P, F, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Confirms that static analysis findings are resolved. Linter warnings left unaddressed accumulate into tech debt and mask real issues.", checks: &["No new linter warnings introduced", "Existing warnings not suppressed without explanation", "Lint config not weakened"], pass_example: "ESLint and Clippy pass with zero warnings on changed files.", @@ -1719,7 +1727,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Active, f1: Some(0.81), pass_at_1: Some(0.76), evaluations: &[P, F, P, P, P, P, F, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Evaluates whether the code follows the team's house style conventions beyond what automated formatters catch \u{2014} naming, file organization, import ordering, and idiomatic patterns.", checks: &["Naming conventions followed (camelCase, snake_case as appropriate)", "Import ordering matches project convention", "Idiomatic patterns used for the language"], pass_example: "New TypeScript module uses camelCase variables, groups imports by source, and uses `Map` instead of plain objects for lookups.", @@ -1738,7 +1746,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Active, f1: Some(0.76), pass_at_1: Some(0.71), evaluations: &[P, P, F, P, F, P, P, P, F, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Checks that the implementation fully covers the specified requirements. Partial implementations ship broken experiences and create follow-up tickets that could have been avoided.", checks: &["All acceptance criteria addressed", "Edge cases handled", "Error states implemented"], pass_example: "Feature handles all three specified user roles with appropriate permissions.", @@ -1751,7 +1759,7 @@ mod verifications { type_: Some(VerificationType::AiAnalysis), mode: VerificationMode::Active, f1: Some(0.84), pass_at_1: Some(0.79), evaluations: &[P, P, P, F, P, P, P, P, P, F], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Identifies potential or likely bugs through static analysis and AI review. Catching defects before merge is orders of magnitude cheaper than finding them in production.", checks: &["No off-by-one errors in loops or slices", "Null/undefined handled at boundaries", "Race conditions considered in async code"], pass_example: "API handler validates input, handles missing fields gracefully, and returns appropriate HTTP status codes.", @@ -1764,7 +1772,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Evaluate, f1: Some(0.69), pass_at_1: Some(0.63), evaluations: &[F, P, P, F, P, F, P, P, F, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Assesses whether the change impacts hot paths or introduces algorithmic regressions. Performance problems that ship to production are expensive to diagnose and fix.", checks: &["No N+1 queries introduced", "Large collections not processed synchronously", "Caching considered for repeated expensive operations"], pass_example: "Database query uses a JOIN instead of N separate queries for related records.", @@ -1783,7 +1791,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.95), pass_at_1: Some(0.93), evaluations: &[P, P, P, P, P, P, F, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Measures whether production code is exercised by automated tests. Coverage gaps mean regressions can ship undetected.", checks: &["New code has corresponding unit tests", "Coverage does not decrease", "Critical paths have integration tests"], pass_example: "New service method has 6 unit tests covering happy path, error cases, and edge cases.", @@ -1796,7 +1804,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Evaluate, f1: Some(0.71), pass_at_1: Some(0.65), evaluations: &[P, F, F, P, P, F, P, F, P, P], - run_status: VerificationStatus::Fail, + run_status: VerificationResult::Fail, detail_description: "Evaluates whether tests are robust, readable, and actually verify behavior rather than implementation details. Low-quality tests give false confidence.", checks: &["Tests verify behavior, not implementation", "Assertions are specific and meaningful", "Tests are independent and deterministic"], pass_example: "Tests assert on API response shape and status codes, not on internal method call counts.", @@ -1809,7 +1817,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.91), pass_at_1: Some(0.88), evaluations: &[P, P, P, F, P, P, P, P, P, P], - run_status: VerificationStatus::Na, + run_status: VerificationResult::Na, detail_description: "Checks that user-facing workflows are exercised by end-to-end browser automation. E2E tests catch integration issues that unit tests miss.", checks: &["Critical user flows have Playwright/Cypress tests", "E2E tests run in CI", "No flaky E2E tests introduced"], pass_example: "New checkout flow has a Playwright test that completes a purchase end-to-end.", @@ -1828,7 +1836,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.88), pass_at_1: Some(0.84), evaluations: &[P, P, P, P, F, P, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Validates that layering and dependency directions conform to the project's architectural design. Architectural violations compound over time and make systems harder to evolve.", checks: &["Dependencies point inward (domain doesn't depend on infra)", "No circular dependencies introduced", "Module boundaries respected"], pass_example: "New repository implementation depends on domain interfaces, not the other way around.", @@ -1841,7 +1849,7 @@ mod verifications { type_: None, mode: VerificationMode::Disabled, f1: None, pass_at_1: None, evaluations: &[], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Reviews public API surfaces for clarity, consistency, and backward compatibility. Interfaces are contracts \u{2014} once published, they're expensive to change.", checks: &["Public API types are well-defined", "Breaking changes documented", "Consistent naming across endpoints"], pass_example: "New endpoint follows existing naming and error format conventions.", @@ -1854,7 +1862,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.96), pass_at_1: Some(0.94), evaluations: &[P, P, P, P, P, P, P, F, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Detects similar or identical code blocks that could be consolidated. Duplication increases maintenance burden and creates inconsistency risk.", checks: &["No copy-pasted logic across files", "Shared utilities used for common patterns", "Similar test setup consolidated"], pass_example: "Date formatting logic extracted into a shared utility used by 4 components.", @@ -1867,7 +1875,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Active, f1: Some(0.74), pass_at_1: Some(0.69), evaluations: &[P, F, P, P, F, P, P, F, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Flags unnecessarily complex code that could be simplified without changing behavior. Simpler code is easier to review, debug, and extend.", checks: &["No premature abstractions", "Control flow is straightforward", "Functions are focused and short"], pass_example: "Conditional logic uses early returns instead of deeply nested if-else chains.", @@ -1880,7 +1888,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.93), pass_at_1: Some(0.90), evaluations: &[P, P, P, P, P, F, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Identifies unexecuted code paths and unused dependencies. Dead code misleads readers and bloats bundles.", checks: &["No unreachable code paths", "Unused imports and variables removed", "Deprecated functions removed if no longer called"], pass_example: "Old feature flag and its associated code paths removed after rollout completed.", @@ -1899,7 +1907,7 @@ mod verifications { type_: Some(VerificationType::AiAnalysis), mode: VerificationMode::Active, f1: Some(0.86), pass_at_1: Some(0.81), evaluations: &[P, P, F, P, P, P, P, P, F, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Scans for known security vulnerabilities using both AI analysis and static scanning tools. Shipping known vulnerabilities exposes users and the organization to risk.", checks: &["No SQL injection or XSS vectors", "User input sanitized at boundaries", "Authentication/authorization checks present"], pass_example: "User input passed through parameterized queries; HTML output escaped.", @@ -1912,7 +1920,7 @@ mod verifications { type_: None, mode: VerificationMode::Disabled, f1: None, pass_at_1: None, evaluations: &[], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Validates infrastructure-as-code definitions against security best practices. Misconfigured infrastructure is a leading cause of data breaches.", checks: &["No publicly accessible storage buckets", "Encryption at rest enabled", "Least-privilege IAM policies"], pass_example: "Terraform module creates S3 bucket with encryption, versioning, and private ACL.", @@ -1925,7 +1933,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.97), pass_at_1: Some(0.95), evaluations: &[P, P, P, P, P, P, P, P, P, F], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Checks that third-party dependencies are free from known CVEs. Vulnerable dependencies are an easy attack vector that automated tools can detect.", checks: &["No dependencies with known critical CVEs", "Lock file updated to patched versions", "Unused dependencies removed"], pass_example: "Dependabot alert resolved by updating lodash from 4.17.20 to 4.17.21.", @@ -1938,7 +1946,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Active, f1: Some(0.80), pass_at_1: Some(0.75), evaluations: &[P, P, F, P, P, F, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Verifies that organization-specific security standards are applied \u{2014} rate limiting, audit logging, CORS policies, and secret management.", checks: &["Secrets not hardcoded in source", "Rate limiting on public endpoints", "Audit logging for sensitive operations"], pass_example: "API key loaded from environment variable; rate limiter configured on login endpoint.", @@ -1957,7 +1965,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.89), pass_at_1: Some(0.85), evaluations: &[P, P, P, P, F, P, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Detects breaking changes in APIs, database schemas, or wire formats that could disrupt consumers. Breaking changes require coordination that surprises prevent.", checks: &["No removed or renamed public API fields", "Database migrations are backward-compatible", "Wire format changes are additive"], pass_example: "New field added to API response; no existing fields removed or renamed.", @@ -1970,7 +1978,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Evaluate, f1: Some(0.66), pass_at_1: Some(0.60), evaluations: &[F, P, F, P, F, P, P, F, P, F], - run_status: VerificationStatus::Fail, + run_status: VerificationResult::Fail, detail_description: "Confirms that the change has a clear deployment plan and can be safely rolled back if issues arise. Every production deploy should be reversible.", checks: &["Feature flag available for gradual rollout", "Database migration is reversible", "Rollback procedure documented"], pass_example: "Feature behind a LaunchDarkly flag with 10% initial rollout and documented rollback steps.", @@ -1983,7 +1991,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Evaluate, f1: Some(0.73), pass_at_1: Some(0.67), evaluations: &[P, F, P, F, P, P, F, P, F, P], - run_status: VerificationStatus::Fail, + run_status: VerificationResult::Fail, detail_description: "Ensures that logging, metrics, and tracing are instrumented for new code paths. Without observability, production issues are invisible until users report them.", checks: &["Structured logging for new operations", "Metrics emitted for key business events", "Distributed tracing propagated"], pass_example: "New payment endpoint logs transaction IDs, emits latency metrics, and propagates trace context.", @@ -1996,7 +2004,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Evaluate, f1: Some(0.78), pass_at_1: Some(0.72), evaluations: &[P, P, F, P, F, P, P, F, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Estimates the infrastructure and operational cost impact of the change. Unchecked cost growth erodes margins and can cause budget surprises.", checks: &["New infrastructure resources sized appropriately", "No unbounded resource consumption", "Cost estimate provided for significant changes"], pass_example: "New Lambda function has memory limit set and estimated monthly cost noted in PR.", @@ -2015,7 +2023,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.94), pass_at_1: Some(0.91), evaluations: &[P, P, P, P, P, P, P, P, F, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Validates that separation-of-duties policies are met \u{2014} the author is not the sole reviewer, approvals are obtained, and the change went through the proper process.", checks: &["PR has at least one approval from non-author", "Required reviewers have signed off", "No self-merging without policy exception"], pass_example: "PR approved by two team members before merge; CI checks all green.", @@ -2028,7 +2036,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.85), pass_at_1: Some(0.80), evaluations: &[P, P, P, F, P, P, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Checks that AI-generated or AI-assisted code meets the organization's governance requirements \u{2014} attribution, review depth, and acceptable use.", checks: &["AI-generated code clearly attributed", "Human review of AI suggestions documented", "AI usage within acceptable-use policy"], pass_example: "PR notes that implementation was AI-assisted; human reviewer verified logic and tests.", @@ -2041,7 +2049,7 @@ mod verifications { type_: Some(VerificationType::Ai), mode: VerificationMode::Active, f1: Some(0.77), pass_at_1: Some(0.72), evaluations: &[P, F, P, P, P, F, P, P, P, F], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Ensures that personally identifiable information (PII) is identified, classified, and handled according to privacy standards (GDPR, CCPA).", checks: &["PII fields identified and documented", "Data retention policies applied", "Consent mechanisms in place for data collection"], pass_example: "New user profile endpoint masks email in logs and respects data deletion requests.", @@ -2054,7 +2062,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.90), pass_at_1: Some(0.87), evaluations: &[P, P, P, P, P, F, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Verifies that UI changes meet accessibility requirements (WCAG 2.1 AA). Inaccessible software excludes users and creates legal risk.", checks: &["Semantic HTML elements used", "ARIA labels present on interactive elements", "Color contrast meets WCAG AA standards"], pass_example: "New modal uses , has aria-labelledby, and focus is trapped within.", @@ -2067,7 +2075,7 @@ mod verifications { type_: Some(VerificationType::Analysis), mode: VerificationMode::Active, f1: Some(0.96), pass_at_1: Some(0.93), evaluations: &[P, P, P, P, P, P, P, P, P, P], - run_status: VerificationStatus::Pass, + run_status: VerificationResult::Pass, detail_description: "Ensures that all third-party dependencies comply with the organization's intellectual property policy. License violations can have severe legal consequences.", checks: &["No GPL-licensed dependencies in proprietary code", "License file present for new dependencies", "Supply chain attestation where required"], pass_example: "New dependency uses MIT license; added to approved dependency list.", @@ -2091,21 +2099,21 @@ mod verifications { .collect() } - fn category_run_status(cat: &CategoryDef) -> VerificationStatus { + fn category_run_status(cat: &CategoryDef) -> VerificationResult { if cat .controls .iter() - .any(|c| c.run_status == VerificationStatus::Fail) + .any(|c| c.run_status == VerificationResult::Fail) { - VerificationStatus::Fail + VerificationResult::Fail } else if cat .controls .iter() - .all(|c| c.run_status == VerificationStatus::Na) + .all(|c| c.run_status == VerificationResult::Na) { - VerificationStatus::Na + VerificationResult::Na } else { - VerificationStatus::Pass + VerificationResult::Pass } } @@ -2172,7 +2180,7 @@ mod verifications { evaluations: ctrl.evaluations.to_vec(), }, control_detail: ControlDetail { - description: ctrl.detail_description.into(), + rationale: ctrl.detail_description.into(), checks: ctrl.checks.iter().map(|s| (*s).into()).collect(), pass_example: ctrl.pass_example.into(), fail_example: ctrl.fail_example.into(), @@ -2468,9 +2476,9 @@ mod insights { pub fn saved_queries() -> Vec { vec![ - SavedQuery { id: "1".into(), name: "Run duration by workflow".into(), sql: "SELECT workflow_name, AVG(duration_seconds) as avg_duration,\n COUNT(*) as run_count\nFROM runs\nGROUP BY workflow_name\nORDER BY avg_duration DESC\nLIMIT 20".into(), created_at: ts("2026-03-01T10:00:00Z"), updated_at: Some(ts("2026-03-05T14:30:00Z")) }, - SavedQuery { id: "2".into(), name: "Daily failure rate".into(), sql: "SELECT date_trunc('day', created_at) as day,\n COUNT(*) FILTER (WHERE status = 'failed') as failures,\n COUNT(*) as total\nFROM runs\nGROUP BY 1\nORDER BY 1 DESC\nLIMIT 30".into(), created_at: ts("2026-03-02T09:00:00Z"), updated_at: None }, - SavedQuery { id: "3".into(), name: "Top repos by activity".into(), sql: "SELECT repo, COUNT(*) as runs\nFROM runs\nGROUP BY repo\nORDER BY runs DESC".into(), created_at: ts("2026-03-03T11:00:00Z"), updated_at: None }, + SavedQuery { id: "1".into(), name: "Run duration by workflow".into(), sql: "SELECT workflow_name, AVG(duration_seconds) as avg_duration,\n COUNT(*) as run_count\nFROM runs\nGROUP BY workflow_name\nORDER BY avg_duration DESC\nLIMIT 20".into(), created_at: ts("2026-03-01T10:00:00Z"), updated_at: ts("2026-03-05T14:30:00Z") }, + SavedQuery { id: "2".into(), name: "Daily failure rate".into(), sql: "SELECT date_trunc('day', created_at) as day,\n COUNT(*) FILTER (WHERE status = 'failed') as failures,\n COUNT(*) as total\nFROM runs\nGROUP BY 1\nORDER BY 1 DESC\nLIMIT 30".into(), created_at: ts("2026-03-02T09:00:00Z"), updated_at: ts("2026-03-02T09:00:00Z") }, + SavedQuery { id: "3".into(), name: "Top repos by activity".into(), sql: "SELECT repo, COUNT(*) as runs\nFROM runs\nGROUP BY repo\nORDER BY runs DESC".into(), created_at: ts("2026-03-03T11:00:00Z"), updated_at: ts("2026-03-03T11:00:00Z") }, ] } diff --git a/crates/arc-api/src/server.rs b/crates/arc-api/src/server.rs index f23d60910..2bbfcfc96 100644 --- a/crates/arc-api/src/server.rs +++ b/crates/arc-api/src/server.rs @@ -6,7 +6,7 @@ use axum::extract::{Path, Query, State}; use axum::http::StatusCode; use axum::response::sse::{Event, Sse}; use axum::response::{IntoResponse, Response}; -use axum::routing::{get, post, put}; +use axum::routing::{get, post}; use axum::{Json, Router}; use tokio::sync::broadcast; use tokio_stream::wrappers::BroadcastStream; @@ -218,7 +218,9 @@ fn demo_routes() -> Router> { ) .route( "/insights/queries/{id}", - put(crate::demo::update_query_stub).delete(crate::demo::delete_query_stub), + get(crate::demo::get_saved_query) + .put(crate::demo::update_query_stub) + .delete(crate::demo::delete_query_stub), ) .route("/insights/execute", post(crate::demo::execute_query_stub)) .route("/insights/history", get(crate::demo::list_query_history)) @@ -267,7 +269,7 @@ fn real_routes() -> Router> { ) .route( "/insights/queries/{id}", - put(not_implemented).delete(not_implemented), + get(not_implemented).put(not_implemented).delete(not_implemented), ) .route("/insights/execute", post(not_implemented)) .route("/insights/history", get(not_implemented)) diff --git a/docs/api-reference/arc-api.yaml b/docs/api-reference/arc-api.yaml index e479a75db..e7fba8910 100644 --- a/docs/api-reference/arc-api.yaml +++ b/docs/api-reference/arc-api.yaml @@ -668,10 +668,13 @@ paths: /verifications: get: - operationId: listVerifications + operationId: listVerificationCategories tags: [Verifications] - summary: List Verifications - description: Returns all verification categories with their controls and performance metrics. + summary: List Verification Categories + description: Returns paginated verification categories with their controls and performance metrics. Each category contains controls; retrieve a specific control via `/verifications/{slug}`. + parameters: + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" responses: "200": description: Array of verification categories @@ -682,10 +685,10 @@ paths: /verifications/{slug}: get: - operationId: retrieveVerification + operationId: retrieveVerificationControl tags: [Verifications] - summary: Retrieve Verification - description: Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. + summary: Retrieve Verification Control + description: Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. Controls are listed within categories returned by `/verifications`. parameters: - $ref: "#/components/parameters/VerificationSlug" responses: @@ -891,6 +894,26 @@ paths: $ref: "#/components/schemas/SavedQuery" /insights/queries/{id}: + get: + operationId: retrieveSavedQuery + tags: [Insights] + summary: Retrieve Saved Query + description: Returns a single saved query by ID. + parameters: + - $ref: "#/components/parameters/InsightQueryId" + responses: + "200": + description: Saved query + content: + application/json: + schema: + $ref: "#/components/schemas/SavedQuery" + "404": + description: Query not found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" put: operationId: updateSavedQuery tags: [Insights] @@ -953,6 +976,12 @@ paths: application/json: schema: $ref: "#/components/schemas/ExecuteQueryResponse" + "400": + description: Bad SQL or query error + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" /insights/history: get: @@ -2198,12 +2227,13 @@ components: # ── Verification Schemas ───────────────────────────────────────────── - VerificationStatus: - description: Result status of a verification control evaluation. + VerificationResult: + description: Outcome of a verification control evaluation. type: string enum: - pass - fail + - skip - na VerificationType: @@ -2234,7 +2264,7 @@ components: type: $ref: "#/components/schemas/VerificationType" status: - $ref: "#/components/schemas/VerificationStatus" + $ref: "#/components/schemas/VerificationResult" RunVerification: description: Verification results for a category within a run. @@ -2254,7 +2284,7 @@ components: description: The guiding question for this verification category. example: Do we understand what this change is and why we're making it? status: - $ref: "#/components/schemas/VerificationStatus" + $ref: "#/components/schemas/VerificationResult" controls: type: array description: Individual control results within this category. @@ -2364,14 +2394,6 @@ components: # ── Verification Detail Schemas ────────────────────────────────────── - EvaluationResult: - description: Outcome of a single verification evaluation. - type: string - enum: - - pass - - fail - - skip - VerificationMode: description: Operational mode of a verification control. type: string @@ -2416,7 +2438,7 @@ components: type: array description: Recent evaluation results (newest first). items: - $ref: "#/components/schemas/EvaluationResult" + $ref: "#/components/schemas/VerificationResult" VerificationCategory: description: A group of related verification controls. @@ -2487,18 +2509,18 @@ components: type: array description: Recent evaluation results (newest first). items: - $ref: "#/components/schemas/EvaluationResult" + $ref: "#/components/schemas/VerificationResult" ControlDetail: description: Detailed information about a verification control including checks and examples. type: object required: - - description + - rationale - checks - pass_example - fail_example properties: - description: + rationale: type: string description: Detailed prose description of the control's purpose and rationale. example: Verifies that every change traces back to a clear origin. @@ -2531,7 +2553,7 @@ components: workflow: $ref: "#/components/schemas/WorkflowReference" result: - $ref: "#/components/schemas/VerificationStatus" + $ref: "#/components/schemas/VerificationResult" timestamp: type: string format: date-time @@ -2896,6 +2918,7 @@ components: - name - sql - created_at + - updated_at properties: id: type: string @@ -2967,7 +2990,12 @@ components: description: Result rows, each an array of values matching the column order. items: type: array - items: {} + items: + oneOf: + - type: string + - type: number + - type: boolean + - type: "null" elapsed: type: number description: Query execution time in seconds. diff --git a/packages/arc-api-client/src/.openapi-generator/FILES b/packages/arc-api-client/src/.openapi-generator/FILES index 37cc9a8d6..01891e048 100644 --- a/packages/arc-api-client/src/.openapi-generator/FILES +++ b/packages/arc-api-client/src/.openapi-generator/FILES @@ -41,8 +41,8 @@ models/diff-file.ts models/diff-stats.ts models/error-response-entry.ts models/error-response.ts -models/evaluation-result.ts models/execute-query-request.ts +models/execute-query-response-rows-inner-inner.ts models/execute-query-response.ts models/feature-flags.ts models/file-checkpoint.ts @@ -127,7 +127,7 @@ models/verification-category.ts models/verification-control.ts models/verification-detail-response.ts models/verification-mode.ts -models/verification-status.ts +models/verification-result.ts models/verification-type.ts models/web-configuration.ts models/workflow-detail.ts diff --git a/packages/arc-api-client/src/api/insights-api.ts b/packages/arc-api-client/src/api/insights-api.ts index d2c89580d..111213ad7 100644 --- a/packages/arc-api-client/src/api/insights-api.ts +++ b/packages/arc-api-client/src/api/insights-api.ts @@ -259,6 +259,47 @@ export const InsightsApiAxiosParamCreator = function (configuration?: Configurat options: localVarRequestOptions, }; }, + /** + * Returns a single saved query by ID. + * @summary Retrieve Saved Query + * @param {string} id Unique identifier of a saved query. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + retrieveSavedQuery: async (id: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('retrieveSavedQuery', 'id', id) + const localVarPath = `/insights/queries/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication mTLS required + await setApiKeyToObject(localVarHeaderParameter, "X-mTLS-Client-CN", configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + localVarHeaderParameter['Accept'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Replaces the name and SQL of an existing saved query. * @summary Update Saved Query @@ -381,6 +422,19 @@ export const InsightsApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['InsightsApi.listSavedQueries']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * Returns a single saved query by ID. + * @summary Retrieve Saved Query + * @param {string} id Unique identifier of a saved query. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async retrieveSavedQuery(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveSavedQuery(id, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InsightsApi.retrieveSavedQuery']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Replaces the name and SQL of an existing saved query. * @summary Update Saved Query @@ -456,6 +510,16 @@ export const InsightsApiFactory = function (configuration?: Configuration, baseP listSavedQueries(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listSavedQueries(pageLimit, pageOffset, options).then((request) => request(axios, basePath)); }, + /** + * Returns a single saved query by ID. + * @summary Retrieve Saved Query + * @param {string} id Unique identifier of a saved query. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + retrieveSavedQuery(id: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.retrieveSavedQuery(id, options).then((request) => request(axios, basePath)); + }, /** * Replaces the name and SQL of an existing saved query. * @summary Update Saved Query @@ -531,6 +595,17 @@ export class InsightsApi extends BaseAPI { return InsightsApiFp(this.configuration).listSavedQueries(pageLimit, pageOffset, options).then((request) => request(this.axios, this.basePath)); } + /** + * Returns a single saved query by ID. + * @summary Retrieve Saved Query + * @param {string} id Unique identifier of a saved query. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + public retrieveSavedQuery(id: string, options?: RawAxiosRequestConfig) { + return InsightsApiFp(this.configuration).retrieveSavedQuery(id, options).then((request) => request(this.axios, this.basePath)); + } + /** * Replaces the name and SQL of an existing saved query. * @summary Update Saved Query diff --git a/packages/arc-api-client/src/api/verifications-api.ts b/packages/arc-api-client/src/api/verifications-api.ts index 4aefdd33a..ac41300db 100644 --- a/packages/arc-api-client/src/api/verifications-api.ts +++ b/packages/arc-api-client/src/api/verifications-api.ts @@ -33,12 +33,14 @@ import type { VerificationDetailResponse } from '../models'; export const VerificationsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Returns all verification categories with their controls and performance metrics. - * @summary List Verifications + * Returns paginated verification categories with their controls and performance metrics. Each category contains controls; retrieve a specific control via `/verifications/{slug}`. + * @summary List Verification Categories + * @param {number} [pageLimit] Maximum number of items to return per page. + * @param {number} [pageOffset] Number of items to skip before returning results. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listVerifications: async (options: RawAxiosRequestConfig = {}): Promise => { + listVerificationCategories: async (pageLimit?: number, pageOffset?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/verifications`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -58,6 +60,14 @@ export const VerificationsApiAxiosParamCreator = function (configuration?: Confi // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) + if (pageLimit !== undefined) { + localVarQueryParameter['page[limit]'] = pageLimit; + } + + if (pageOffset !== undefined) { + localVarQueryParameter['page[offset]'] = pageOffset; + } + localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -70,15 +80,15 @@ export const VerificationsApiAxiosParamCreator = function (configuration?: Confi }; }, /** - * Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. - * @summary Retrieve Verification + * Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. Controls are listed within categories returned by `/verifications`. + * @summary Retrieve Verification Control * @param {string} slug URL-safe slug identifying a verification control. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - retrieveVerification: async (slug: string, options: RawAxiosRequestConfig = {}): Promise => { + retrieveVerificationControl: async (slug: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'slug' is not null or undefined - assertParamExists('retrieveVerification', 'slug', slug) + assertParamExists('retrieveVerificationControl', 'slug', slug) const localVarPath = `/verifications/{slug}` .replace(`{${"slug"}}`, encodeURIComponent(String(slug))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -120,28 +130,30 @@ export const VerificationsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = VerificationsApiAxiosParamCreator(configuration) return { /** - * Returns all verification categories with their controls and performance metrics. - * @summary List Verifications + * Returns paginated verification categories with their controls and performance metrics. Each category contains controls; retrieve a specific control via `/verifications/{slug}`. + * @summary List Verification Categories + * @param {number} [pageLimit] Maximum number of items to return per page. + * @param {number} [pageOffset] Number of items to skip before returning results. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listVerifications(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listVerifications(options); + async listVerificationCategories(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listVerificationCategories(pageLimit, pageOffset, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['VerificationsApi.listVerifications']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['VerificationsApi.listVerificationCategories']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. - * @summary Retrieve Verification + * Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. Controls are listed within categories returned by `/verifications`. + * @summary Retrieve Verification Control * @param {string} slug URL-safe slug identifying a verification control. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async retrieveVerification(slug: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveVerification(slug, options); + async retrieveVerificationControl(slug: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveVerificationControl(slug, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['VerificationsApi.retrieveVerification']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['VerificationsApi.retrieveVerificationControl']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } @@ -154,23 +166,25 @@ export const VerificationsApiFactory = function (configuration?: Configuration, const localVarFp = VerificationsApiFp(configuration) return { /** - * Returns all verification categories with their controls and performance metrics. - * @summary List Verifications + * Returns paginated verification categories with their controls and performance metrics. Each category contains controls; retrieve a specific control via `/verifications/{slug}`. + * @summary List Verification Categories + * @param {number} [pageLimit] Maximum number of items to return per page. + * @param {number} [pageOffset] Number of items to skip before returning results. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listVerifications(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listVerifications(options).then((request) => request(axios, basePath)); + listVerificationCategories(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.listVerificationCategories(pageLimit, pageOffset, options).then((request) => request(axios, basePath)); }, /** - * Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. - * @summary Retrieve Verification + * Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. Controls are listed within categories returned by `/verifications`. + * @summary Retrieve Verification Control * @param {string} slug URL-safe slug identifying a verification control. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - retrieveVerification(slug: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.retrieveVerification(slug, options).then((request) => request(axios, basePath)); + retrieveVerificationControl(slug: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.retrieveVerificationControl(slug, options).then((request) => request(axios, basePath)); }, }; }; @@ -180,24 +194,26 @@ export const VerificationsApiFactory = function (configuration?: Configuration, */ export class VerificationsApi extends BaseAPI { /** - * Returns all verification categories with their controls and performance metrics. - * @summary List Verifications + * Returns paginated verification categories with their controls and performance metrics. Each category contains controls; retrieve a specific control via `/verifications/{slug}`. + * @summary List Verification Categories + * @param {number} [pageLimit] Maximum number of items to return per page. + * @param {number} [pageOffset] Number of items to skip before returning results. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public listVerifications(options?: RawAxiosRequestConfig) { - return VerificationsApiFp(this.configuration).listVerifications(options).then((request) => request(this.axios, this.basePath)); + public listVerificationCategories(pageLimit?: number, pageOffset?: number, options?: RawAxiosRequestConfig) { + return VerificationsApiFp(this.configuration).listVerificationCategories(pageLimit, pageOffset, options).then((request) => request(this.axios, this.basePath)); } /** - * Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. - * @summary Retrieve Verification + * Returns detailed information about a specific verification control, including performance data, recent results, and sibling controls in the same category. Controls are listed within categories returned by `/verifications`. + * @summary Retrieve Verification Control * @param {string} slug URL-safe slug identifying a verification control. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public retrieveVerification(slug: string, options?: RawAxiosRequestConfig) { - return VerificationsApiFp(this.configuration).retrieveVerification(slug, options).then((request) => request(this.axios, this.basePath)); + public retrieveVerificationControl(slug: string, options?: RawAxiosRequestConfig) { + return VerificationsApiFp(this.configuration).retrieveVerificationControl(slug, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/arc-api-client/src/models/control-detail.ts b/packages/arc-api-client/src/models/control-detail.ts index 81d6e1ebb..82484b927 100644 --- a/packages/arc-api-client/src/models/control-detail.ts +++ b/packages/arc-api-client/src/models/control-detail.ts @@ -21,7 +21,7 @@ export interface ControlDetail { /** * Detailed prose description of the control\'s purpose and rationale. */ - 'description': string; + 'rationale': string; /** * Specific checks performed by this control. */ diff --git a/packages/arc-api-client/src/models/control-performance.ts b/packages/arc-api-client/src/models/control-performance.ts index 6f16563bf..e345ff2dc 100644 --- a/packages/arc-api-client/src/models/control-performance.ts +++ b/packages/arc-api-client/src/models/control-performance.ts @@ -15,10 +15,10 @@ // May contain unused imports in some cases // @ts-ignore -import type { EvaluationResult } from './evaluation-result'; +import type { VerificationMode } from './verification-mode'; // May contain unused imports in some cases // @ts-ignore -import type { VerificationMode } from './verification-mode'; +import type { VerificationResult } from './verification-result'; /** * Performance metrics for a verification control. @@ -36,7 +36,7 @@ export interface ControlPerformance { /** * Recent evaluation results (newest first). */ - 'evaluations': Array; + 'evaluations': Array; } diff --git a/packages/arc-api-client/src/models/execute-query-response-rows-inner-inner.ts b/packages/arc-api-client/src/models/execute-query-response-rows-inner-inner.ts new file mode 100644 index 000000000..af47f15e9 --- /dev/null +++ b/packages/arc-api-client/src/models/execute-query-response-rows-inner-inner.ts @@ -0,0 +1,22 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Arc Run API + * HTTP API for managing Arc workflow run executions. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * @type ExecuteQueryResponseRowsInnerInner + */ +export type ExecuteQueryResponseRowsInnerInner = boolean | number | string; + + diff --git a/packages/arc-api-client/src/models/execute-query-response.ts b/packages/arc-api-client/src/models/execute-query-response.ts index ca09f2eae..36c0e6603 100644 --- a/packages/arc-api-client/src/models/execute-query-response.ts +++ b/packages/arc-api-client/src/models/execute-query-response.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import type { ExecuteQueryResponseRowsInnerInner } from './execute-query-response-rows-inner-inner'; /** * Columnar result set from an executed query. @@ -25,7 +28,7 @@ export interface ExecuteQueryResponse { /** * Result rows, each an array of values matching the column order. */ - 'rows': Array>; + 'rows': Array>; /** * Query execution time in seconds. */ diff --git a/packages/arc-api-client/src/models/index.ts b/packages/arc-api-client/src/models/index.ts index 7ce9a84dc..738d787f9 100644 --- a/packages/arc-api-client/src/models/index.ts +++ b/packages/arc-api-client/src/models/index.ts @@ -23,9 +23,9 @@ export * from './diff-file'; export * from './diff-stats'; export * from './error-response'; export * from './error-response-entry'; -export * from './evaluation-result'; export * from './execute-query-request'; export * from './execute-query-response'; +export * from './execute-query-response-rows-inner-inner'; export * from './feature-flags'; export * from './file-checkpoint'; export * from './file-diff'; @@ -108,7 +108,7 @@ export * from './verification-category'; export * from './verification-control'; export * from './verification-detail-response'; export * from './verification-mode'; -export * from './verification-status'; +export * from './verification-result'; export * from './verification-type'; export * from './web-configuration'; export * from './workflow-detail'; diff --git a/packages/arc-api-client/src/models/recent-control-result.ts b/packages/arc-api-client/src/models/recent-control-result.ts index cc2ad2e63..c768d30e5 100644 --- a/packages/arc-api-client/src/models/recent-control-result.ts +++ b/packages/arc-api-client/src/models/recent-control-result.ts @@ -18,7 +18,7 @@ import type { RunReference } from './run-reference'; // May contain unused imports in some cases // @ts-ignore -import type { VerificationStatus } from './verification-status'; +import type { VerificationResult } from './verification-result'; // May contain unused imports in some cases // @ts-ignore import type { WorkflowReference } from './workflow-reference'; @@ -29,7 +29,7 @@ import type { WorkflowReference } from './workflow-reference'; export interface RecentControlResult { 'run': RunReference; 'workflow': WorkflowReference; - 'result': VerificationStatus; + 'result': VerificationResult; /** * ISO 8601 timestamp of the evaluation. */ diff --git a/packages/arc-api-client/src/models/run-verification-control.ts b/packages/arc-api-client/src/models/run-verification-control.ts index 6f78ca2e9..8a4477379 100644 --- a/packages/arc-api-client/src/models/run-verification-control.ts +++ b/packages/arc-api-client/src/models/run-verification-control.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import type { VerificationStatus } from './verification-status'; +import type { VerificationResult } from './verification-result'; // May contain unused imports in some cases // @ts-ignore import type { VerificationType } from './verification-type'; @@ -33,7 +33,7 @@ export interface RunVerificationControl { */ 'description': string; 'type'?: VerificationType; - 'status': VerificationStatus; + 'status': VerificationResult; } diff --git a/packages/arc-api-client/src/models/run-verification.ts b/packages/arc-api-client/src/models/run-verification.ts index 0b86a6c35..392e96202 100644 --- a/packages/arc-api-client/src/models/run-verification.ts +++ b/packages/arc-api-client/src/models/run-verification.ts @@ -18,7 +18,7 @@ import type { RunVerificationControl } from './run-verification-control'; // May contain unused imports in some cases // @ts-ignore -import type { VerificationStatus } from './verification-status'; +import type { VerificationResult } from './verification-result'; /** * Verification results for a category within a run. @@ -32,7 +32,7 @@ export interface RunVerification { * The guiding question for this verification category. */ 'question': string; - 'status': VerificationStatus; + 'status': VerificationResult; /** * Individual control results within this category. */ diff --git a/packages/arc-api-client/src/models/saved-query.ts b/packages/arc-api-client/src/models/saved-query.ts index 91ed2cfe7..18407940a 100644 --- a/packages/arc-api-client/src/models/saved-query.ts +++ b/packages/arc-api-client/src/models/saved-query.ts @@ -37,6 +37,6 @@ export interface SavedQuery { /** * Timestamp when the query was last modified. */ - 'updated_at'?: string; + 'updated_at': string; } diff --git a/packages/arc-api-client/src/models/verification-control.ts b/packages/arc-api-client/src/models/verification-control.ts index ccf584769..5f944b997 100644 --- a/packages/arc-api-client/src/models/verification-control.ts +++ b/packages/arc-api-client/src/models/verification-control.ts @@ -15,10 +15,10 @@ // May contain unused imports in some cases // @ts-ignore -import type { EvaluationResult } from './evaluation-result'; +import type { VerificationMode } from './verification-mode'; // May contain unused imports in some cases // @ts-ignore -import type { VerificationMode } from './verification-mode'; +import type { VerificationResult } from './verification-result'; // May contain unused imports in some cases // @ts-ignore import type { VerificationType } from './verification-type'; @@ -52,7 +52,7 @@ export interface VerificationControl { /** * Recent evaluation results (newest first). */ - 'evaluations'?: Array; + 'evaluations'?: Array; } diff --git a/packages/arc-api-client/src/models/verification-result.ts b/packages/arc-api-client/src/models/verification-result.ts new file mode 100644 index 000000000..14afa674b --- /dev/null +++ b/packages/arc-api-client/src/models/verification-result.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Arc Run API + * HTTP API for managing Arc workflow run executions. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * Outcome of a verification control evaluation. + */ + +export const VerificationResult = { + PASS: 'pass', + FAIL: 'fail', + SKIP: 'skip', + NA: 'na' +} as const; + +export type VerificationResult = typeof VerificationResult[keyof typeof VerificationResult]; + + +