Commit Graph

38 Commits

Author SHA1 Message Date
Émile Ré
319b3ec7fb Add missing generated comments and llm records
Signed-off-by: Émile Ré <emile@probo.com>
2026-07-28 10:31:49 +02:00
Sacha Al Himdani
4c57d201a4 Make license declarations consistently MIT
The source headers, LICENSE files, and license metadata had drifted
apart. Align the entire project to MIT:

- Convert every source-file header to the MIT text across all comment
  styles (Go, TS, TSX, JS, MJS, SQL, CSS, GraphQL, shell), including
  SPDX-License-Identifier tags
- Set the root and cookie-banner LICENSE files to the MIT text with a
  "MIT License" title line
- Switch the package.json license fields, Docker image label, and
  cookie-banner README to MIT
- Update docs and the genmodels header generator accordingly
- Normalize copyright lines to a single format
  (Copyright (c) <year(s)> Probo Inc <hello@probo.com>.): unify the
  hello@getprobo.com and hello@probo.inc emails to hello@probo.com and
  the comma-separated years to a hyphenated range

Genuine third-party references are intentionally left untouched: the
Lucide icon attributions (Lucide is ISC) and the trivy dependency
license allowlist.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
2026-07-13 16:21:14 +02:00
Cursor Agent
73023fc2b8 Fix Anthropic thinking budgets
Normalize Anthropic thinking budgets while building message parameters so budget_tokens stays below max_tokens with response headroom. When the configured max token budget is too small to support Anthropic's minimum thinking budget, omit thinking for that request instead of sending an invalid payload.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Sacha Al Himdani <SachaProbo@users.noreply.github.com>
2026-07-07 13:51:11 +00:00
Ludovic Vielle
f30e63edd0 Update llm registry gen file
Signed-off-by: Ludovic Vielle <ludovic@probo.com>
2026-07-02 18:58:06 +02:00
Sacha Al Himdani
9ac71f948f Update contact email to hello@probo.com
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-06-09 16:45:23 +02:00
Émile Ré
cdf055591b Drop obsolete LLM request sanitization test
The client no longer strips sampling parameters per model, so the
sanitization test and its capturing provider helper assert behavior
that was intentionally removed. Delete them to restore a green build.

Signed-off-by: Émile Ré <emile@probo.com>
2026-06-01 14:49:13 +02:00
Émile Ré
8cf770613a Drop request sanitization from LLM client
Remove sanitizeRequest and its call sites so the client no longer
strips sampling parameters based on the model registry. Unsupported
knobs are now avoided by setting the config carefully per model
rather than silently mutating outgoing requests.

Signed-off-by: Émile Ré <emile@probo.com>
2026-06-01 13:39:42 +02:00
Émile Ré
c8b7615046 Fix lint issues
Signed-off-by: Émile Ré <emile@probo.com>
2026-06-01 13:17:17 +02:00
Émile Ré
dbd868679d Drop sampling params unsupported by the model
The common-pattern enrichment and tracker-mapping agents run on
reasoning models such as gpt-5-nano, which reject an explicit
temperature and fail the whole request with a 400 ("Unsupported
value: 'temperature' does not support 0.1 with this model"). The
model registry already records this capability, but nothing
consulted it before dispatch, and dated provider snapshots like
gpt-5-nano-2025-08-07 did not resolve in the registry.

Resolve dated snapshots to their undated base model in registry
Lookup, and sanitize each chat completion request in the LLM
client by omitting the sampling knobs the target model does not
accept (temperature, top_p, frequency/presence penalties, stop).
Unknown models are left untouched, so models absent from the
registry keep their current behavior.

Signed-off-by: Émile Ré <emile@probo.com>
2026-06-01 13:17:17 +02:00
Émile Ré
f5703d390b Enforce Go style rules across codebase
Apply five style rules: convert iota string enums to typed
string constants, replace errors.As with errors.AsType,
merge three-group imports into two groups, fix multiline
parameter/argument formatting, and replace fmt.Sprintf URL
construction with net/url.

Signed-off-by: Émile Ré <emile@probo.com>
2026-05-20 11:46:39 +04:00
Émile Ré
9156d6a16a Add wsl linter and fix
Signed-off-by: Émile Ré <emile@probo.com>
2026-05-20 09:27:28 +04:00
Aurélien Sibiril
ff18a5fc23 Remove json tags from internal structs
JSON marshaling uses field names directly; explicit tags
are unnecessary at this level.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-26 22:58:21 +02:00
Aurélien Sibiril
19a2610056 Add JSON serialization to LLM message types
Message, Part (Text/Image/File), ToolCall, FunctionCall, and Usage
now round-trip through JSON. Message uses a type-discriminated
envelope for the Part interface. Required for checkpoint persistence.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-26 22:58:21 +02:00
Aurélien Sibiril
509d0c88b1 Add vendor assessment agent
Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-24 08:43:14 +02:00
Bryan Frimin
11770b4058 Add OAuth2/OpenID Connect authorization server
Implement a full OAuth2 2.0 and OpenID Connect 1.0 authorization
server with support for authorization code flow (with PKCE),
refresh token rotation, device authorization grant, dynamic
client registration, token introspection, and token revocation.

Includes database schema, coredata layer, service logic, HTTP
handlers, OIDC discovery endpoint, and JWKS publishing.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-04-19 12:00:53 +02:00
Aurélien Sibiril
f65b6e8cfb Add go:generate directive for genmodels
Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 18:25:11 +02:00
Aurélien Sibiril
481b56402a Derive provider from model ID
The provider is always the prefix before "/" in the model ID,
so storing it as a separate field is redundant. Replace the
field with a Provider() method.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 18:25:11 +02:00
Aurélien Sibiril
b4910cf511 Use controlled test data in registry tests
Build registries from inline map literals instead of relying
on generated OpenRouter data that can change between runs.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 18:25:10 +02:00
Aurélien Sibiril
02c719dfdd Use map for generated model registry data
Replaces []ModelDefinition with map[string]ModelDefinition so
model ID uniqueness is enforced by the data structure itself
and lookups do not require a linear scan.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 18:25:10 +02:00
Aurélien Sibiril
3f4ef7b104 Emit all supported parameter flags explicitly
Always write both true and false values in the generated
registry so unsupported parameters are visible at a glance
instead of relying on Go zero-value defaults.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 18:25:10 +02:00
Aurélien Sibiril
3365171672 Add model registry tests
Lookup by canonical ID, bare name, and normalized form.
Capability assertions for Claude, GPT-5.4, and o3. Edge
cases for empty string and provider-prefix-only inputs.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 18:25:10 +02:00
Aurélien Sibiril
c9ba7510c5 Add generated model registry data
177 models across 9 providers fetched from OpenRouter.
This file is generated by go generate and committed to avoid
requiring an API call at build time.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 18:25:10 +02:00
Aurélien Sibiril
45d9a9e43b Add model registry types and lookup
ModelDefinition, SupportedParameters, and Registry types with
multi-key lookup supporting canonical, bare, and normalized
model IDs. NewRegistry constructor accepts model definitions
for testability; DefaultRegistry caches the generated data.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
2026-04-13 18:25:10 +02:00
Bryan Frimin
619ec7b882 Add AI-powered evidence description generation
Introduce a background worker that automatically generates
compliance-focused descriptions for uploaded evidence files
using configurable LLM providers. Descriptions are surfaced
across all interfaces: GraphQL API, MCP API, CLI, and the
console UI.

Key changes:
- Multi-provider LLM config with per-agent settings (pointer
  types for Temperature/MaxTokens to preserve zero values)
- Evidence description worker with bounded concurrency
- EvidenceDescriptionStatus typed enum with PostgreSQL enum type
- New `prb evidence` CLI commands (list, view, delete)
- Evidence description displayed in console table and preview
- Migration only marks evidences without files as completed

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-26 14:32:41 +01:00
Sacha Al Himdani
8c02c53315 Update copyright headers across all Go files
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-25 17:38:32 +01:00
Sacha Al Himdani
16b966b8fb Fix multiline function call style violations
Expand mixed inline/multiline function calls so each argument
is on its own line, matching the one-argument-per-line rule.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-17 15:59:26 +01:00
Bryan Frimin
6a77d42dd6 Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-16 00:28:47 +01:00
Bryan Frimin
d01ee914c1 Style
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 20:00:22 +01:00
Bryan Frimin
cb6189d7ac Close inner stream before finalizing trace span
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 19:40:54 +01:00
Bryan Frimin
91be6dcbfb Preserve extra JSON Schema fields in Anthropic tools
buildTools was only copying "properties" and "required" into
ToolInputSchemaParam, silently dropping root-level constraints
like additionalProperties and $defs. Forward them through the
SDK's ExtraFields map so the full schema reaches the API.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 19:36:44 +01:00
Bryan Frimin
2df9a3fe59 Propagate model through streamed responses
StreamAccumulator never set its model field, so
Response().Model was always empty for streamed
completions. Add a Model field to stream events
and populate it in all three providers (OpenAI,
Anthropic, Bedrock).

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 19:17:17 +01:00
Bryan Frimin
9e842b8ef3 Map missing model settings to OpenAI API params
FrequencyPenalty, PresencePenalty, and ParallelToolCalls were
present on ChatCompletionRequest but never forwarded in
buildParams, so agent-level settings configured via functional
options were silently ignored for the OpenAI provider.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 19:07:56 +01:00
Bryan Frimin
659ff1e845 Honor JSONSchema.Strict in OpenAI response format
buildResponseFormat was hardcoding strict: true instead of
reading rf.JSONSchema.Strict, making it impossible to request
non-strict JSON-schema output.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 19:02:12 +01:00
Bryan Frimin
3b9a13b5d9 Only advance streamed tool-call index for tool-use blocks
Incrementing toolIndex on every ContentBlockStop caused it to drift
when non-tool blocks (e.g. text) preceded tool-use blocks, making
Bedrock tool calls disappear from the accumulated response.

Track whether the current content block is a tool-use block and only
bump the index when a tool-use block ends.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 18:26:38 +01:00
Bryan Frimin
356de5ab19 Fix Bedrock ToolChoiceNone still sending tool definitions
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 18:20:22 +01:00
Bryan Frimin
0670f581da Skip empty text block in Anthropic tool-only assistant turns
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 18:19:57 +01:00
Bryan Frimin
9fd251ee5d Add agent library
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 17:21:43 +01:00
Bryan Frimin
158c36d9ab Add LLM interface
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-13 17:21:43 +01:00