Documentation
¶
Overview ¶
Package portunus is the exported root of the PORTUNUS module.
PORTUNUS is an open-source, compliance-first AI gateway. All implementation lives under internal/ (ADR-0009); this package deliberately exposes only build/version identity and, in the future, the Go embedding entry point. It must never grow business logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Version ¶
func Version() string
Version reports the version string set at build time, or "dev" for non-release builds.
func VersionString ¶
func VersionString() string
VersionString returns the full human-readable build identity, suitable for `portunus version` output and the audit log's gateway.version field (ADR-0007 envelope).
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
portunus
command
The portunus command is the PORTUNUS gateway binary.
|
The portunus command is the PORTUNUS gateway binary. |
|
Package compliance embeds the audit compliance-reference map — the versioned event_type → framework-citation table (ADR-0007 §3): which regulatory record each audit event constitutes.
|
Package compliance embeds the audit compliance-reference map — the versioned event_type → framework-citation table (ADR-0007 §3): which regulatory record each audit event constitutes. |
|
examples
|
|
|
quickstart/fakeupstream
command
Command fakeupstream is a tiny OpenAI-compatible upstream for the PORTUNUS quickstart — it lets the demo run end-to-end with NO real provider API key.
|
Command fakeupstream is a tiny OpenAI-compatible upstream for the PORTUNUS quickstart — it lets the demo run end-to-end with NO real provider API key. |
|
internal
|
|
|
adapter
Package adapter defines the provider adapter contract and the normalized upstream error taxonomy (ADR-0008).
|
Package adapter defines the provider adapter contract and the normalized upstream error taxonomy (ADR-0008). |
|
adapter/anthropic
Package anthropic is the native Anthropic Messages API adapter — the one hand-built translation in v0.1 (ADR-0003/0008).
|
Package anthropic is the native Anthropic Messages API adapter — the one hand-built translation in v0.1 (ADR-0003/0008). |
|
adapter/openaicompat
Package openaicompat is the catch-all provider adapter (ADR-0008 §2/§3): one adapter, many providers, driven entirely by preset data (presets/*.yaml).
|
Package openaicompat is the catch-all provider adapter (ADR-0008 §2/§3): one adapter, many providers, driven entirely by preset data (presets/*.yaml). |
|
assemble
Package assemble resolves the enabled compliance packs into a deterministic policy plan (ADR-0021): one entry per distinct policy id (the shared transform runs once), the set-valued config unioned across packs, every framework citation accumulated, and validated fail-closed against the implemented entity set.
|
Package assemble resolves the enabled compliance packs into a deterministic policy plan (ADR-0021): one entry per distinct policy id (the shared transform runs once), the set-valued config unioned across packs, every framework citation accumulated, and validated fail-closed against the implemented entity set. |
|
audit
Package audit produces PORTUNUS's tamper-evident audit log — the artifact auditors and regulators actually touch (ADR-0007).
|
Package audit produces PORTUNUS's tamper-evident audit log — the artifact auditors and regulators actually touch (ADR-0007). |
|
auth
Package auth authenticates gateway clients and produces the audit actor + authorization identity for a request (ADR-0019).
|
Package auth authenticates gateway clients and produces the audit actor + authorization identity for a request (ADR-0019). |
|
config
Package config loads, validates, and defaults portunus.yaml — the single file that configures a v0.1 deployment (ADR-0003 §IN-7).
|
Package config loads, validates, and defaults portunus.yaml — the single file that configures a v0.1 deployment (ADR-0003 §IN-7). |
|
emit
Package emit is the audit emission layer: it turns a completed engine Exchange — plus the inputs only the orchestrator holds (the original prompt, the response, provider gen_ai metadata, trace context, actor auth) — into typed audit events and appends them to the tamper-evident chain (ADR-0007 §2).
|
Package emit is the audit emission layer: it turns a completed engine Exchange — plus the inputs only the orchestrator holds (the original prompt, the response, provider gen_ai metadata, trace context, actor auth) — into typed audit events and appends them to the tamper-evident chain (ADR-0007 §2). |
|
engine
Package engine implements the Exchange pipeline — the heart of PORTUNUS (ADR-0005).
|
Package engine implements the Exchange pipeline — the heart of PORTUNUS (ADR-0005). |
|
gateway
Package gateway is the assembler: it wires a resolved configuration into a running server — the engine (request tokenize → dispatch → response detokenize, ADR-0005 §1), the provider adapter + dispatcher (ADR-0008), the audit emitter, and client authentication (ADR-0019).
|
Package gateway is the assembler: it wires a resolved configuration into a running server — the engine (request tokenize → dispatch → response detokenize, ADR-0005 §1), the provider adapter + dispatcher (ADR-0008), the audit emitter, and client authentication (ADR-0019). |
|
policy
Package policy contains PORTUNUS's policy implementations — one subpackage per policy, flat and discoverable (ADR-0005, ADR-0009).
|
Package policy contains PORTUNUS's policy implementations — one subpackage per policy, flat and discoverable (ADR-0005, ADR-0009). |
|
policy/injectionguard
Package injectionguard is PORTUNUS's deterministic prompt-injection heuristic detector — the always-on, pure-Go layer of the layered guard (ADR-0022 §2, ADR-0003 §5).
|
Package injectionguard is PORTUNUS's deterministic prompt-injection heuristic detector — the always-on, pure-Go layer of the layered guard (ADR-0022 §2, ADR-0003 §5). |
|
policy/piidetect
Package piidetect is PORTUNUS's deterministic PII recognizer engine — it decides WHAT to tokenize (ADR-0006 §1, ADR-0016).
|
Package piidetect is PORTUNUS's deterministic PII recognizer engine — it decides WHAT to tokenize (ADR-0006 §1, ADR-0016). |
|
policy/piitokenize
Package piitokenize is PORTUNUS's reversible PII tokenization policy (pii.tokenize) — the crown-jewel transform (ADR-0006).
|
Package piitokenize is PORTUNUS's reversible PII tokenization policy (pii.tokenize) — the crown-jewel transform (ADR-0006). |
|
registry
Package registry merges the embedded pack and preset catalogs with user overrides into the validated, effective set the engine runs (ADR-0005 §4, ADR-0008 §3).
|
Package registry merges the embedded pack and preset catalogs with user overrides into the validated, effective set the engine runs (ADR-0005 §4, ADR-0008 §3). |
|
server
Package server is PORTUNUS's HTTP front door: the OpenAI-compatible surfaces /v1/chat/completions and /v1/responses, listener lifecycle, and SSE plumbing (ADR-0003, ADR-0008).
|
Package server is PORTUNUS's HTTP front door: the OpenAI-compatible surfaces /v1/chat/completions and /v1/responses, listener lifecycle, and SSE plumbing (ADR-0003, ADR-0008). |
|
store
Package store provides PORTUNUS's embedded persistence: a single SQLite file via the pure-Go driver, keeping the zero-dependency single-binary promise (ADR-0003, ADR-0009; supersedes ADR-0001's Postgres-first plan for v0.1 — Postgres arrives in v0.2 behind these same interfaces).
|
Package store provides PORTUNUS's embedded persistence: a single SQLite file via the pure-Go driver, keeping the zero-dependency single-binary promise (ADR-0003, ADR-0009; supersedes ADR-0001's Postgres-first plan for v0.1 — Postgres arrives in v0.2 behind these same interfaces). |
|
vault
Package vault stores PII↔token mappings — the most sensitive component of any PORTUNUS deployment (ADR-0006).
|
Package vault stores PII↔token mappings — the most sensitive component of any PORTUNUS deployment (ADR-0006). |
|
Package packs embeds the compliance pack catalog — regulations as data (ADR-0005 §4).
|
Package packs embeds the compliance pack catalog — regulations as data (ADR-0005 §4). |
|
Package presets embeds the provider preset catalog — providers as data, community support as data-only PRs (ADR-0008 §3).
|
Package presets embeds the provider preset catalog — providers as data, community support as data-only PRs (ADR-0008 §3). |
Click to show internal directories.
Click to hide internal directories.
