Skip to content

Commit 31377ea

Browse files
Merge branch 'main' into AGE-2064
2 parents 33e9d6d + c65b813 commit 31377ea

81 files changed

Lines changed: 1660 additions & 401 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@truefoundry/trueforge-core': major
3+
'@truefoundry/trueforge': major
4+
---
5+
6+
Replace string creator fields (`created_by` / `triggered_by`) with a non-null `created_by_subject` JSON object on agent, session, schedule, and schedule_run. Ownership and list filters use `tenant_id` + `created_by_subject.subject_id`.

‎.changeset/postgres-ssl.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@truefoundry/trueforge": patch
3+
---
4+
5+
Apply `POSTGRES_SSL_MODE` as `sslmode` on the Postgres connection URL.

‎.github/fern/openapi/openapi.json‎

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"Agent": {
2727
"additionalProperties": false,
2828
"properties": {
29+
"created_by_subject": {
30+
"$ref": "#/components/schemas/CreatedBySubject"
31+
},
2932
"id": {
3033
"description": "Immutable server-generated agent identifier.",
3134
"minLength": 1,
@@ -41,7 +44,8 @@
4144
"required": [
4245
"id",
4346
"name",
44-
"manifest"
47+
"manifest",
48+
"created_by_subject"
4549
],
4650
"type": "object"
4751
},
@@ -1102,6 +1106,33 @@
11021106
},
11031107
"type": "object"
11041108
},
1109+
"CreatedBySubject": {
1110+
"additionalProperties": false,
1111+
"description": "Who created this resource.",
1112+
"properties": {
1113+
"subject_display_name": {
1114+
"description": "Display name.",
1115+
"minLength": 1,
1116+
"type": "string"
1117+
},
1118+
"subject_id": {
1119+
"description": "Subject id.",
1120+
"minLength": 1,
1121+
"type": "string"
1122+
},
1123+
"subject_type": {
1124+
"description": "Subject type.",
1125+
"minLength": 1,
1126+
"type": "string"
1127+
}
1128+
},
1129+
"required": [
1130+
"subject_id",
1131+
"subject_type",
1132+
"subject_display_name"
1133+
],
1134+
"type": "object"
1135+
},
11051136
"CronExpression": {
11061137
"description": "Standard 5-field cron expression, evaluated in `timezone`.",
11071138
"pattern": "^[\\d*,\\-/]+(?:\\s+[\\d*,\\-/]+){4}$",
@@ -3114,8 +3145,8 @@
31143145
"format": "date-time",
31153146
"type": "string"
31163147
},
3117-
"created_by": {
3118-
"type": "string"
3148+
"created_by_subject": {
3149+
"$ref": "#/components/schemas/CreatedBySubject"
31193150
},
31203151
"id": {
31213152
"type": "string"
@@ -3136,7 +3167,7 @@
31363167
"agent_name",
31373168
"name",
31383169
"manifest",
3139-
"created_by",
3170+
"created_by_subject",
31403171
"created_at",
31413172
"updated_at"
31423173
],
@@ -3173,6 +3204,9 @@
31733204
"format": "date-time",
31743205
"type": "string"
31753206
},
3207+
"created_by_subject": {
3208+
"$ref": "#/components/schemas/CreatedBySubject"
3209+
},
31763210
"id": {
31773211
"type": "string"
31783212
},
@@ -3196,9 +3230,6 @@
31963230
"null"
31973231
]
31983232
},
3199-
"triggered_by": {
3200-
"type": "string"
3201-
},
32023233
"updated_at": {
32033234
"format": "date-time",
32043235
"type": "string"
@@ -3210,7 +3241,7 @@
32103241
"name",
32113242
"scheduled_for",
32123243
"status",
3213-
"triggered_by",
3244+
"created_by_subject",
32143245
"triggered_at",
32153246
"created_at",
32163247
"updated_at"
@@ -3242,9 +3273,8 @@
32423273
"description": "ISO 8601 creation timestamp.",
32433274
"type": "string"
32443275
},
3245-
"created_by": {
3246-
"description": "Caller identity that created the session (immutable).",
3247-
"type": "string"
3276+
"created_by_subject": {
3277+
"$ref": "#/components/schemas/CreatedBySubject"
32483278
},
32493279
"id": {
32503280
"description": "Unique session id.",
@@ -3272,7 +3302,7 @@
32723302
"id",
32733303
"agent",
32743304
"title",
3275-
"created_by",
3305+
"created_by_subject",
32763306
"created_at",
32773307
"updated_at",
32783308
"metrics",
@@ -6713,7 +6743,7 @@
67136743
},
67146744
"/api/v1/sessions": {
67156745
"get": {
6716-
"description": "List the caller's sessions (newest first by default), token-paginated. Results are scoped to the authenticated identity via the session store's `created_by` filter (not a client query param). Optional `agent_id` filters to sessions bound to that named agent. Pass `page_token` to fetch the next page, keeping the other query params constant.",
6746+
"description": "List the caller's sessions (newest first by default), token-paginated. Results are scoped to the authenticated identity via the session store's `created_by_subject.subject_id` filter (not a client query param). Optional `agent_id` filters to sessions bound to that named agent. Pass `page_token` to fetch the next page, keeping the other query params constant.",
67176747
"parameters": [
67186748
{
67196749
"description": "Page size. Defaults to 25, max 25.",
@@ -6884,7 +6914,7 @@
68846914
},
68856915
"/api/v1/sessions/{session_id}": {
68866916
"delete": {
6887-
"description": "Delete a session and all related turns, events, and internal state. Only the session creator (`created_by`) may delete it. Idempotent if already gone.",
6917+
"description": "Delete a session and all related turns, events, and internal state. Only the session creator may delete it. Idempotent if already gone.",
68886918
"parameters": [
68896919
{
68906920
"description": "Session identifier.",
@@ -6924,7 +6954,7 @@
69246954
"x-fern-sdk-method-name": "delete"
69256955
},
69266956
"get": {
6927-
"description": "Fetch a session by ID. Only the session creator (`created_by`) may fetch it.",
6957+
"description": "Fetch a session by ID. Only the session creator may fetch it.",
69286958
"parameters": [
69296959
{
69306960
"description": "Session identifier.",
@@ -6981,7 +7011,7 @@
69817011
"x-fern-sdk-method-name": "get"
69827012
},
69837013
"patch": {
6984-
"description": "Update a session by replacing `agent` with `{ spec: AgentSpec }`. Named (reference) sessions reject agent updates. An empty body is a valid no-op that refreshes `updated_at`. Only the session creator (`created_by`) may update it.",
7014+
"description": "Update a session by replacing `agent` with `{ spec: AgentSpec }`. Named (reference) sessions reject agent updates. An empty body is a valid no-op that refreshes `updated_at`. Only the session creator may update it.",
69857015
"parameters": [
69867016
{
69877017
"description": "Session identifier.",
@@ -7070,7 +7100,7 @@
70707100
},
70717101
"/api/v1/sessions/{session_id}/cancel": {
70727102
"post": {
7073-
"description": "Cancel the running last turn for a session. Only the session creator (`created_by`) may cancel.",
7103+
"description": "Cancel the running last turn for a session. Only the session creator may cancel.",
70747104
"parameters": [
70757105
{
70767106
"description": "Session identifier.",
@@ -7149,7 +7179,7 @@
71497179
},
71507180
"/api/v1/sessions/{session_id}/events": {
71517181
"get": {
7152-
"description": "List session events as `{ turn_id, event }` across the active turn branch (newest first), including persisted events from a running tip. Each turn contributes turn.created, content events (model.message, tool.call, …), and turn.done when terminal; streaming deltas are not included. Use `page_token` to paginate backward toward older events while retaining the original branch anchor. Only the session creator (`created_by`) may list events.",
7182+
"description": "List session events as `{ turn_id, event }` across the active turn branch (newest first), including persisted events from a running tip. Each turn contributes turn.created, content events (model.message, tool.call, …), and turn.done when terminal; streaming deltas are not included. Use `page_token` to paginate backward toward older events while retaining the original branch anchor. Only the session creator may list events.",
71537183
"parameters": [
71547184
{
71557185
"description": "Session identifier.",
@@ -7256,7 +7286,7 @@
72567286
},
72577287
"/api/v1/sessions/{session_id}/turns": {
72587288
"get": {
7259-
"description": "List turns for a session (newest first by default), token-paginated. Only the session creator (`created_by`) may list turns.",
7289+
"description": "List turns for a session (newest first by default), token-paginated. Only the session creator may list turns.",
72607290
"parameters": [
72617291
{
72627292
"description": "Session identifier.",
@@ -7351,7 +7381,7 @@
73517381
"x-fern-sdk-method-name": "list_turns"
73527382
},
73537383
"post": {
7354-
"description": "Create a turn within a session and execute it.\nOnly the session creator (`created_by`) may create turns.\nWhen `stream` is true (default), respond with a Server-Sent Events stream of turn events.\nWhen `stream` is false, return the turn immediately with `state.status: \"running\"` while execution continues in the background; use get turn or subscribe to observe completion.\nUse `previous_turn_id` to chain to the session's last turn (defaults to `auto`); use `none` for a new root.",
7384+
"description": "Create a turn within a session and execute it.\nOnly the session creator may create turns.\nWhen `stream` is true (default), respond with a Server-Sent Events stream of turn events.\nWhen `stream` is false, return the turn immediately with `state.status: \"running\"` while execution continues in the background; use get turn or subscribe to observe completion.\nUse `previous_turn_id` to chain to the session's last turn (defaults to `auto`); use `none` for a new root.",
73557385
"parameters": [
73567386
{
73577387
"description": "Session identifier.",
@@ -7486,7 +7516,7 @@
74867516
},
74877517
"/api/v1/sessions/{session_id}/turns/{turn_id}": {
74887518
"get": {
7489-
"description": "Fetch a single turn by ID. Only the session creator (`created_by`) may fetch it.",
7519+
"description": "Fetch a single turn by ID. Only the session creator may fetch it.",
74907520
"parameters": [
74917521
{
74927522
"description": "Session identifier.",
@@ -7556,7 +7586,7 @@
75567586
},
75577587
"/api/v1/sessions/{session_id}/turns/{turn_id}/download-sandbox-file": {
75587588
"get": {
7559-
"description": "Download a file from the sandbox this turn ran in. Paths come from the assistant's `sandbox_artifacts` block. Only the session creator (`created_by`) may download.",
7589+
"description": "Download a file from the sandbox this turn ran in. Paths come from the assistant's `sandbox_artifacts` block. Only the session creator may download.",
75607590
"parameters": [
75617591
{
75627592
"description": "Session identifier.",
@@ -7688,7 +7718,7 @@
76887718
},
76897719
"/api/v1/sessions/{session_id}/turns/{turn_id}/events": {
76907720
"get": {
7691-
"description": "Paginated persisted events for a turn (insertion order by default). Only the session creator (`created_by`) may list events.",
7721+
"description": "Paginated persisted events for a turn (insertion order by default). Only the session creator may list events.",
76927722
"parameters": [
76937723
{
76947724
"description": "Session identifier.",
@@ -7805,7 +7835,7 @@
78057835
},
78067836
"/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe": {
78077837
"get": {
7808-
"description": "Subscribe to the live SSE stream for a turn. Only the session creator (`created_by`) may subscribe. Pass `after_sequence_number` to resume after a disconnect (exclusive — events after this sequence number are replayed).",
7838+
"description": "Subscribe to the live SSE stream for a turn. Only the session creator may subscribe. Pass `after_sequence_number` to resume after a disconnect (exclusive — events after this sequence number are replayed).",
78097839
"parameters": [
78107840
{
78117841
"description": "Session identifier.",

‎charts/trueforge/templates/_helpers.tpl‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ fields, wires bundled Postgres/Redis, optional OIDC, then server.extraEnv.
206206
{{- $env = append $env (dict "name" "POSTGRES_PASSWORD" "valueFrom" (dict "secretKeyRef" (dict "name" (include "trueforge.postgres.secretName" .) "key" "password"))) -}}
207207
{{- else -}}
208208
{{- $env = append $env (include "trueforge.env.fromStringOrValueFrom" (dict "name" "POSTGRES_PASSWORD" "field" "externalPostgres.password" "value" .Values.externalPostgres.password) | fromJson) -}}
209+
{{- if .Values.externalPostgres.sslMode -}}
210+
{{- $env = append $env (dict "name" "POSTGRES_SSL_MODE" "value" .Values.externalPostgres.sslMode) -}}
211+
{{- end -}}
209212
{{- end -}}
210213

211214
{{- if .Values.configs.oidc.enabled -}}

‎charts/trueforge/values.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ externalPostgres:
178178
# secretKeyRef:
179179
# name: my-postgres-secret
180180
# key: password
181+
# Optional TLS for the app → Postgres pool (`POSTGRES_SSL_MODE`). Empty = unset (no TLS).
182+
# Modes: disable | prefer | require | verify-ca | verify-full | no-verify.
183+
sslMode: ""
181184
externalRedis:
182185
# Full connection URL, e.g. redis://:password@redis-master.databases.svc:6379.
183186
# string, or { valueFrom: { secretKeyRef: { name, key } } }. Prefer valueFrom in prod.

0 commit comments

Comments
 (0)