Compare commits

...
79 Commits
Author SHA1 Message Date
CI ea072700e8 Bump version to 0.1.0-RC.33 [skip ci] 2026-11-20 16:13:15 +00:00
james.maes bfdf9e7792 Merge pull request 'feat(schema): every table has a create date and a modify date (release 0.1)' (#119) from feat/table-standard-dates-0.1 into release/0.1
maven / build (push) Successful in 14m58s
build / maven (push) Successful in 14m58s
2026-11-20 15:58:19 +00:00
james.maesandClaude Fable 5.2 7f1db4cae1 fix(schema): a row written once has modifyDate equal to createDate exactly
maven / build (push) Successful in 10m40s
build / maven (push) Successful in 10m40s
QQQ's createDate and modifyDate behaviors each read the clock, so the two
values of one insert differ by a few microseconds on a clock finer than the
machine this was first run on. The decision claim and the budget event are
written once and never change; an insert customizer on those two tables makes
modifyDate the same instant as createDate. The test of the other tables no
longer asserts equality they cannot give (they are rewritten when a
transcript is redacted).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 09:13:39 -06:00
james.maesandClaude Fable 5.2 09a176dae6 feat(schema): every table has a create date and a modify date
maven / build (push) Failing after 10m50s
build / maven (push) Failing after 10m50s
Nine tables lacked a standard date: eight had createDate but no modifyDate
(turn events, tool calls, feedback, model calls, data audit, budget events,
client errors, pending action claims) and the budget accounting table had
neither. All nine now declare both, date-time, not editable, set by QQQ.

Every write the QBit makes goes through QQQ's own insert and update actions,
so an insert sets both and an update (an incremented daily usage counter, a
decided pending action, a cleared tool result, a scheduled run that ends, the
accounting row that follows a usage row) moves modifyDate. A table that is
only inserted has modifyDate equal to createDate.

The reference DDL gets an additive block (nullable columns defaulting to the
time of the write, so the previous release keeps working; existing rows get
the table's own creation time). Tests iterate the declared tables, exercise
the store's insert and update paths, and check the DDL creates the columns.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 08:46:00 -06:00
CI 3a6fd1b809 Bump version to 0.1.0-RC.32 [skip ci] 2026-11-18 17:36:52 +00:00
james.maes d8a1168210 Merge pull request 'release: merge develop into release/0.1 (one confirmation for a set, compact answers, file reading, links)' (#117) from rc/develop-into-release-0.1-one-card-files into release/0.1
maven / build (push) Successful in 11m15s
build / maven (push) Successful in 11m15s
2026-11-18 17:25:42 +00:00
james.maesandClaude Fable 5.2 55bcf1a509 release: merge develop into release/0.1 (one confirmation for a set, compact answers, no silent stop at the output ceiling, widgets follow data access, file reading where a host turns it on, links the application gave)
maven / build (push) Successful in 9m18s
build / maven (push) Successful in 9m18s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-18 11:15:05 -06:00
CI b4bda50ae2 Bump version to 0.1.0-RC.31 [skip ci] 2026-11-14 14:37:13 +00:00
james.maes a4b2b01612 Merge pull request 'release: merge develop into release/0.1 (one tool registry, tool-call service, signed-in writes, spending limit, process confirmation)' (#111) from rc/develop-into-release-0.1-registry into release/0.1
maven / build (push) Successful in 8m54s
build / maven (push) Successful in 8m54s
2026-11-14 14:28:28 +00:00
james.maesandClaude Fable 5.2 a51fd12799 release: merge develop into release/0.1 (one tool registry, tool-call service, signed-in writes, spending limit, process confirmation)
maven / build (push) Successful in 8m7s
build / maven (push) Successful in 8m7s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 07:17:14 -06:00
CI 88aec4afec Bump version to 0.1.0-RC.30 [skip ci] 2026-11-11 17:22:56 +00:00
james.maes ceb31a71b3 Merge pull request 'release: merge develop into release/0.1 (the store as trusted code, a person's own budget)' (#103) from rc/develop-into-release-0.1-everyone into release/0.1
maven / build (push) Successful in 5m33s
build / maven (push) Successful in 5m33s
2026-11-11 17:17:32 +00:00
james.maesandClaude Fable 5.2 e3f68bf7ee Merge develop into release/0.1 for the next 0.1.0 RC (the store as trusted code, a person's own budget)
maven / build (push) Successful in 6m4s
build / maven (push) Successful in 6m5s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 11:10:47 -06:00
CI e37602b71e Bump version to 0.1.0-RC.29 [skip ci] 2026-11-11 16:21:20 +00:00
james.maes cd1cdaa1c0 Merge pull request 'release: merge develop into release/0.1 (weekly budgets, refusal sentence, limit ceiling)' (#101) from rc/develop-into-release-0.1-weekly into release/0.1
maven / build (push) Successful in 5m34s
build / maven (push) Successful in 5m34s
2026-11-11 16:15:55 +00:00
james.maesandClaude Fable 5.2 1ae7bb9cfa Merge develop into release/0.1 for the next 0.1.0 RC (weekly budgets, refusal sentence, limit ceiling)
maven / build (push) Successful in 5m16s
build / maven (push) Successful in 5m16s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 10:08:23 -06:00
CI 6d66deabc9 Bump version to 0.1.0-RC.28 [skip ci] 2026-11-11 14:03:10 +00:00
james.maes 08c8264f23 Merge pull request 'release: merge develop into release/0.1 (save_analysis, decided actions, ask before guessing)' (#99) from rc/develop-into-release-0.1-save into release/0.1
maven / build (push) Successful in 5m55s
build / maven (push) Successful in 5m55s
2026-11-11 13:57:25 +00:00
james.maesandClaude Fable 5.2 07b06f2070 Merge develop into release/0.1 for the next 0.1.0 RC (save_analysis, decided actions, ask before guessing)
maven / build (push) Successful in 5m13s
build / maven (push) Successful in 5m13s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 07:51:36 -06:00
CI 61fca48424 Bump version to 0.1.0-RC.27 [skip ci] 2026-11-11 13:51:22 +00:00
james.maes d761bd4a7d Merge pull request 'release: merge develop into release/0.1 (analyze_records)' (#97) from rc/develop-into-release-0.1-analyze into release/0.1
maven / build (push) Successful in 6m16s
build / maven (push) Successful in 6m16s
2026-11-11 13:45:08 +00:00
james.maes f1634b0911 Merge develop into release/0.1 for the next 0.1.0 RC (analyze_records)
maven / build (push) Successful in 6m27s
build / maven (push) Successful in 6m27s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

# Conflicts:
#	CHANGELOG.md
#	pom.xml
2026-11-11 07:34:30 -06:00
CI feab4caf17 Bump version to 0.1.0-RC.26 [skip ci] 2026-11-09 15:59:36 +00:00
james.maes ba21b72188 Merge pull request 'fix(engine): a stalled database can no longer hang a turn on 'Thinking'' (#94) from fix/turn-watchdog-never-hangs into release/0.1
maven / build (push) Successful in 5m5s
build / maven (push) Successful in 5m5s
2026-11-09 15:54:38 +00:00
james.maesandClaude Sonnet 5.5 0a65702dab fix(engine): a stalled database can no longer hang a turn on 'Thinking'
maven / build (push) Successful in 5m3s
build / maven (push) Successful in 5m3s
The watchdog ran the deadline logic after two database reads and heartbeat() was synchronized on the monitor that finish() needs, so one blocked database call stopped the deadline, the force-finalize and the final message.end. The deadline now runs first with no database access, housekeeping runs on a bounded abandonable worker, finish() has a guard that ends the stream with an error event, and every phase logs at INFO.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 09:48:47 -06:00
CI 739ca6981f Bump version to 0.1.0-RC.25 [skip ci] 2026-11-07 17:28:54 +00:00
james.maes b51dd4dad1 Merge pull request 'release: merge develop into release/0.1 (Gitea-aligned RC)' (#92) from align/develop-into-release-0.1 into release/0.1
maven / build (push) Successful in 8m11s
build / maven (push) Successful in 8m11s
2026-11-07 17:20:44 +00:00
james.maesandClaude Opus 5.5 c3a03b8d84 Merge develop into release/0.1 (Gitea-aligned RC)
maven / build (push) Canceled after 37s
build / maven (push) Canceled after 43s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:19:04 -06:00
james.maes 2d25f0b769 Merge pull request 'fix(assistant): store the transcript before message.end so the panel shows the answer' (#85) from fix/transcript-stored-before-message-end into release/0.1
QRun-IO/ci-policy: ci / fork-guard (push) Skipped
QRun-IO/ci-policy: ci / head-profile (push) Skipped
QRun-IO/ci-policy: ci / application-template-0 (push) Skipped
QRun-IO/ci-policy: ci / gradle-1 (push) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (push) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (push) Skipped
QRun-IO/ci-policy: ci / java-maven-6 (push) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (push) Skipped
QRun-IO/ci-policy: ci / node-8 (push) Skipped
QRun-IO/ci-policy: ci / node-9 (push) Skipped
QRun-IO/ci-policy: ci / node-10 (push) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (push) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (push) Skipped
QRun-IO/ci-policy: ci / source-config-13 (push) Skipped
QRun-IO/ci-policy: ci / source-config-14 (push) Skipped
QRun-IO/ci-policy: ci / android-0 (push) Skipped
QRun-IO/ci-policy: ci / original-business (push) Skipped
QRun-IO/ci-policy: ci / original-mcp (push) Skipped
QRun-IO/ci-policy: ci / original-voyage (push) Skipped
QRun-IO/ci-policy: ci / original-cli (push) Skipped
QRun-IO/ci-policy: ci / not-enrolled (push) Skipped
QRun-IO/ci-policy: native / fork-deny (push) Skipped
QRun-IO/ci-policy: native / dotnet-0 (push) Skipped
QRun-IO/ci-policy: native / native-result (push) Successful in 7s
QRun-IO/ci-policy: Shared Java Maven CI with Docker / secrets (push) Successful in 29s
QRun-IO/ci-policy: ci / repository-policy (push) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (push) Skipped
QRun-IO/ci-policy: ci / java-docker-3-head (push) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (push) Skipped
QRun-IO/ci-policy: ci / java-maven-7-head (push) Skipped
QRun-IO/ci-policy: Shared Java Maven CI with Docker / verify (push) Successful in 5m57s
QRun-IO/ci-policy: Shared Java Maven CI with Docker / gate (push) Successful in 16s
QRun-IO/ci-policy: ci / java-docker-3 (push) Successful in 24m15s
QRun-IO/ci-policy: ci / ci-result (push) Successful in 8s
2026-11-05 10:17:10 +00:00
james.maesandClaude Sonnet 5.5 c5125f9788 fix(assistant): store the transcript before message.end so the panel shows the answer
QRun-IO/ci-policy: ci / fork-guard (pull_request) Skipped
QRun-IO/ci-policy: ci / head-profile (pull_request) Skipped
QRun-IO/ci-policy: ci / application-template-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / gradle-1 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-8 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-9 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-10 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-13 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-14 (pull_request) Skipped
QRun-IO/ci-policy: ci / android-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / original-business (pull_request) Skipped
QRun-IO/ci-policy: ci / original-mcp (pull_request) Skipped
QRun-IO/ci-policy: ci / original-voyage (pull_request) Skipped
QRun-IO/ci-policy: ci / original-cli (pull_request) Skipped
QRun-IO/ci-policy: ci / not-enrolled (pull_request) Skipped
QRun-IO/ci-policy: native / fork-deny (pull_request) Skipped
QRun-IO/ci-policy: native / dotnet-0 (pull_request) Skipped
QRun-IO/ci-policy: native / native-result (pull_request) Successful in 11s
QRun-IO/ci-policy: Shared Java Maven CI with Docker / secrets (pull_request) Successful in 36s
QRun-IO/ci-policy: ci / repository-policy (pull_request) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-3-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7-head (pull_request) Skipped
QRun-IO/ci-policy: Shared Java Maven CI with Docker / verify (pull_request) Successful in 7m8s
QRun-IO/ci-policy: Shared Java Maven CI with Docker / gate (pull_request) Successful in 23s
QRun-IO/ci-policy: ci / java-docker-3 (pull_request) Successful in 12m50s
QRun-IO/ci-policy: ci / ci-result (pull_request) Successful in 10s
The panel reloads the conversation the moment the stream ends. The
redacted transcript (message parts, pending actions, stored events) was
flushed only after message.end was sent, so that reload read the "[]"
placeholders and showed the newest question and answer as empty bubbles
until the panel was closed and reopened. Persist and flush first, then
emit message.end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 19:15:44 -06:00
james.maesandCodex 3de664e0fd ci: centralize release branch verification and workflows (#75)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 12:38:46 -05:00
CircleCI 2caa634044 Bump version to 0.1.0-RC.24 [skip ci] 2026-10-16 17:08:39 +00:00
james.maesandClaude Opus 5.5 c77e5b0123 Merge develop into release/0.1 for 0.1.0-RC.24 (#62 optional unreachable providers report DEGRADED)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:59:08 -05:00
CircleCI f46735b1c0 Bump version to 0.1.0-RC.23 [skip ci] 2026-10-16 16:04:25 +00:00
github-actions[bot] 86563c64d2 Merge develop into release/0.1 for the next 0.1.0 RC 2026-10-16 15:58:52 +00:00
CircleCI 82febe0f19 Bump version to 0.1.0-RC.22 [skip ci] 2026-10-16 02:27:26 +00:00
james.maesandClaude Opus 5.5 1ea23dfc49 Merge develop into release/0.1 for 0.1.0-RC.22 (#60 fail-soft assistant server)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:17:28 -05:00
CircleCI 9d31de46a6 Bump version to 0.1.0-RC.21 [skip ci] 2026-10-16 01:13:38 +00:00
james.maesandClaude Opus 5.5 24b0b3b14a Merge develop into release/0.1 for 0.1.0-RC.21 (#59 records render always carries rows and columns)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 20:04:06 -05:00
CircleCI 1c33e97664 Bump version to 0.1.0-RC.20 [skip ci] 2026-10-15 21:41:12 +00:00
james.maesandClaude Opus 5.5 fcaf2ded7e Merge develop into release/0.1 for 0.1.0-RC.20 (#56 UI API 1.6.0 extension, QQQ RC.15)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 16:30:07 -05:00
CircleCI 2cea8ffd44 Bump version to 0.1.0-RC.19 [skip ci] 2026-10-15 21:12:25 +00:00
james.maesandClaude Opus 5.5 6b98d5216b Merge develop into release/0.1 for 0.1.0-RC.19 (#57 shutdown hook holds the runtime weakly)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 16:04:27 -05:00
CircleCI 6adf390bf8 Bump version to 0.1.0-RC.18 [skip ci] 2026-10-15 03:36:35 +00:00
james.maesandClaude Opus 5.5 bc92c89665 Merge develop into release/0.1 for 0.1.0-RC.18 (#45 health checks)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:29:33 -05:00
CircleCI d43402e262 Bump version to 0.1.0-RC.17 [skip ci] 2026-10-15 02:40:56 +00:00
james.maesandClaude Opus 5.5 fe725ac8ff Merge develop into release/0.1 for 0.1.0-RC.17 (#54 assistant answers in the Jobs tray, QQQ RC.8)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:32:46 -05:00
CircleCI dfb05d8935 Bump version to 0.1.0-RC.16 [skip ci] 2026-10-15 02:20:24 +00:00
james.maesandClaude Opus 5.5 523fd0128a Merge develop into release/0.1 for 0.1.0-RC.16 (#53 help bundle)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:11:51 -05:00
CircleCI 47115fe359 Bump version to 0.1.0-RC.15 [skip ci] 2026-10-15 00:18:50 +00:00
james.maesandClaude Opus 5.5 f2d2b50459 Merge develop into release/0.1 for 0.1.0-RC.15 (#44 transcript redaction)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:10:35 -05:00
CircleCI 8c33db9fcf Bump version to 0.1.0-RC.14 [skip ci] 2026-10-14 23:13:46 +00:00
james.maesandClaude Opus 5.5 75a5dedf7f Merge develop into release/0.1 for 0.1.0-RC.14 (#46, #47 indexes and FKs)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:07:05 -05:00
CircleCI c1cceaf4c3 Bump version to 0.1.0-RC.13 [skip ci] 2026-10-14 22:27:30 +00:00
james.maesandClaude Opus 5.5 f8a114bbb8 Merge develop into release/0.1 for 0.1.0-RC.13 (#48 seeds and Setup card, #49 durable turns, #50 seed fixes, #52 rollback)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:20:45 -05:00
CircleCI 3a7ff1c659 Bump version to 0.1.0-RC.12 [skip ci] 2026-10-14 16:03:00 +00:00
james.maesandClaude Opus 5.5 ea81166454 Merge develop into release/0.1 for 0.1.0-RC.12 (#19 #39 #40 #42 #43)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:56:16 -05:00
CircleCI cfcc044055 Bump version to 0.1.0-RC.11 [skip ci] 2026-10-14 12:57:45 +00:00
james.maesandClaude Opus 5.5 620dee488d Merge develop into release/0.1 for 0.1.0-RC.11 (#36 scheduled tasks, #37 provider-api module)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 07:51:34 -05:00
CircleCI e23206f1e8 Bump version to 0.1.0-RC.10 [skip ci] 2026-10-14 12:12:23 +00:00
james.maesandClaude Opus 5.5 c6bae3bcf2 Merge develop into release/0.1 for 0.1.0-RC.10 (#38 bulk-load tools)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 07:09:32 -05:00
CircleCI 2d8459bb24 Bump version to 0.1.0-RC.9 [skip ci] 2026-10-14 01:42:57 +00:00
james.maesandClaude Opus 5.5 ac06a96787 Merge develop into release/0.1 for 0.1.0-RC.9 (presentation #32, RAG and contingent PVs #33, demo #34, P-d/P-e)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:39:02 -05:00
CircleCI d4a1f64480 Bump version to 0.1.0-RC.8 [skip ci] 2026-10-14 00:55:57 +00:00
james.maesandClaude Opus 5.5 c28e782075 Merge develop into release/0.1 for 0.1.0-RC.8 (core alerts #31, budgets #26, routing #27)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 19:52:20 -05:00
CircleCI 5c76a13245 Bump version to 0.1.0-RC.7 [skip ci] 2026-10-13 23:31:30 +00:00
james.maesandClaude Opus 5.5 8d1348888d Merge develop into release/0.1 for 0.1.0-RC.7
Provider/model registry and OpenAI-compatible adapter (#22), Bedrock and
Vertex (#23), data classification, PHI routing and HIPAA mode (#24).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 18:28:10 -05:00
CircleCI 47cc572c36 Bump version to 0.1.0-RC.6 [skip ci] 2026-10-13 19:51:20 +00:00
james.maesandClaude Opus 5.5 8099f64bf2 Merge develop into release/0.1 for 0.1.0-RC.6
Tools via /qqq/v1 with a loopback stand-in (#14); profiles, skills,
explain access, denials, ArchUnit and the denial matrix (#15); #16; the
demo pending-action card (#18).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:49:14 -05:00
CircleCI ac6ec75deb Bump version to 0.1.0-RC.5 [skip ci] 2026-10-13 18:44:09 +00:00
james.maesandClaude Opus 5.5 1f48a370e3 Merge develop into release/0.1 for 0.1.0-RC.5
Tools are no longer all sent as strict, so Anthropic no longer rejects
every turn with "compiled grammar is too large" (#13).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 13:40:36 -05:00
CircleCI d0ad2aa0fa Bump version to 0.1.0-RC.4 [skip ci] 2026-10-13 15:24:59 +00:00
james.maesandClaude Opus 5.5 16c8500f59 Merge develop into release/0.1 for 0.1.0-RC.4
App home, provider settings with Test connection, per-call usage and
model prices (#12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:23:04 -05:00
CircleCI a8c5f586ee Bump version to 0.1.0-RC.3 [skip ci] 2026-10-12 21:22:35 +00:00
james.maesandClaude Opus 5.5 3dfa775b21 Merge develop into release/0.1 for 0.1.0-RC.3
Assistant Admin record screens (#6), deterministic RobustnessTest (#9)
and the GA-only tag filter (#8), on top of the snake_case rename (#3).
0.1.0-RC.2 on Central is an accidental republish of RC.1, so this
candidate is RC.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:20:10 -05:00
james.maesandClaude Opus 5.5 67f78fd660 ci: fix the GA tag filter YAML (no brackets in the flow sequence) [skip ci]
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:01:54 -05:00
james.maesandClaude Opus 5.5 ff67c6f7cc Set version to 0.1.0-RC.2 and publish only GA tags [skip ci]
0.1.0-RC.2 is already on Maven Central (an RC tag build republished the previous code), so the next release-branch build must publish the following RC. RC tags no longer trigger a publish (/^v[0-9]+\.[0-9]+\.[0-9]+$/ only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:56:59 -05:00
james.maesandClaude Opus 5.5 19551ac2af Merge develop into release/0.1 for 0.1.0-RC.2
Brings the snake_case assistant_ table and key names (#3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:18:00 -05:00
james.maesandClaude Opus 5.5 7263ac627d Bump version to 0.1.0-RC.1 [skip ci]
The orb published 0.1.0-RC.1 but could not push this commit (the
CircleCI deploy key is read only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 12:49:33 -05:00
17 changed files with 890 additions and 1 deletions

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
# Changelog
## Unreleased - Every table has a create date and a modify date
- Nine tables lacked a standard date: `assistant_turn_event`, `assistant_tool_call`, `assistant_feedback`, `assistant_usage`, `assistant_data_audit`, `assistant_budget_event`, `assistant_client_error` and `assistant_pending_action_claim` had `createDate` but no `modifyDate`, and `assistant_budget_usage` had neither. All nine now declare both, `DATE_TIME`, not editable, set by QQQ (`CREATE_DATE` and `MODIFY_DATE` behaviors); every other table already had them.
- Every write the QBit makes goes through QQQ's insert and update actions, so an insert sets both dates and an update (an incremented daily usage counter, a decided pending action, a cleared tool result, a scheduled run that ends, the budget accounting row that follows a usage row) moves `modifyDate` and leaves `createDate`. A row of a table whose rows never change (`assistant_pending_action_claim`, `assistant_budget_event`) has `modifyDate` equal to `createDate` exactly: QQQ's two date behaviors read the clock separately, so a new insert customizer (`AssistantInsertOnlyDatesCustomizer`, registered by the QBit on those two tables) makes the two one instant. The other new `modifyDate` values are QQQ's own (turn events, feedback, client errors and the data audit are inserted once, and rewritten only when a transcript is redacted).
- `docs/schema-postgres.sql` has a new block at its end (additive; see UPGRADE.md): the columns are nullable and default to the time of the write, so the previous release keeps working against the same database while a host migrates.
## Unreleased - The assistant can read the files of records, where a host turns that on; a link in an answer is one the application gave
Design: `docs/file-contents-and-links.md`. **Off by default: an upgrade changes nothing until a host turns file reading on in code (see `UPGRADE.md`).**
+21
View File
@@ -1,5 +1,26 @@
# Upgrading qbit-assistant
## Every table has create and modify dates (Unreleased)
Nine tables gain columns: `modify_date` on `assistant_turn_event`, `assistant_tool_call`,
`assistant_feedback`, `assistant_usage`, `assistant_data_audit`, `assistant_budget_event`,
`assistant_client_error` and `assistant_pending_action_claim`, and `create_date` and `modify_date` on
`assistant_budget_usage` (the names an application gets when it derives snake_case backend names from
field names; otherwise `modifyDate` and `createDate`). A host that writes its own migrations runs
the block at the end of `docs/schema-postgres.sql` ("Table standard") **before** deploying this release:
- It is safe while the previous release is still running against the same database: the columns are
nullable and default to `CURRENT_TIMESTAMP`, so rows the previous release inserts are given a value.
On PostgreSQL 11 and later adding a column with that (stable) default does not rewrite the table.
- The `UPDATE` statements give existing rows the table's own creation time (`occurred_at` for
`assistant_budget_usage`). They touch every row: on a large table (`assistant_usage`,
`assistant_tool_call`, `assistant_turn_event`) run each in id ranges, and run them before the new
release starts writing, or they overwrite real `modify_date` values.
- `assistant_pending_action_claim` and `assistant_budget_event` rows are written once: their `modifyDate` equals their `createDate` and never moves.
Nothing else changes: no configuration, no code to change. A host whose database is made from
the reference DDL, or whose own migrations run the block, needs no customizer.
## The assistant can read the files of records (Unreleased)
**Nothing changes on upgrade: reading the content of files is off until a host turns it on in code.** Turned on, the assistant reads the content of a file a record holds, for a person who may open it. An answer keeps no address of the application that the application did not give. No schema change, no permission, no API change. Design: `docs/file-contents-and-links.md`.
+34
View File
@@ -777,3 +777,37 @@ CREATE TABLE IF NOT EXISTS assistant_pending_action_claim
CONSTRAINT assistant_pending_action_claim_action UNIQUE (pending_action_id)
);
CREATE INDEX IF NOT EXISTS assistant_pending_action_claim_user_id ON assistant_pending_action_claim (user_id);
-- Table standard: every table has create_date and modify_date. Eight tables had only
-- create_date and assistant_budget_usage had neither. Additive and safe while the
-- previous release is still running against the same database:
-- * the columns are nullable and default to the time of the write, so rows the previous
-- release inserts (it does not know the columns) are still given a value;
-- * on PostgreSQL 11 and later adding a column whose default is CURRENT_TIMESTAMP
-- (STABLE, evaluated once at ALTER time) does not rewrite the table and takes only a
-- short lock;
-- * the UPDATE statements give existing rows the table's own creation time (for
-- assistant_budget_usage, occurred_at, the usage row's creation time). They touch every
-- row, so on a large table (assistant_usage, assistant_tool_call, assistant_turn_event)
-- run each one in id ranges (AND id BETWEEN a AND b). Run them BEFORE the new release
-- starts writing: afterwards they would overwrite real modify_date values.
-- Safe to re-run.
ALTER TABLE assistant_turn_event ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_turn_event SET modify_date = create_date WHERE create_date IS NOT NULL AND modify_date IS DISTINCT FROM create_date;
ALTER TABLE assistant_tool_call ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_tool_call SET modify_date = create_date WHERE create_date IS NOT NULL AND modify_date IS DISTINCT FROM create_date;
ALTER TABLE assistant_feedback ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_feedback SET modify_date = create_date WHERE create_date IS NOT NULL AND modify_date IS DISTINCT FROM create_date;
ALTER TABLE assistant_usage ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_usage SET modify_date = create_date WHERE create_date IS NOT NULL AND modify_date IS DISTINCT FROM create_date;
ALTER TABLE assistant_data_audit ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_data_audit SET modify_date = create_date WHERE create_date IS NOT NULL AND modify_date IS DISTINCT FROM create_date;
ALTER TABLE assistant_budget_event ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_budget_event SET modify_date = create_date WHERE create_date IS NOT NULL AND modify_date IS DISTINCT FROM create_date;
ALTER TABLE assistant_client_error ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_client_error SET modify_date = create_date WHERE create_date IS NOT NULL AND modify_date IS DISTINCT FROM create_date;
ALTER TABLE assistant_pending_action_claim ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_pending_action_claim SET modify_date = create_date WHERE create_date IS NOT NULL AND modify_date IS DISTINCT FROM create_date;
ALTER TABLE assistant_budget_usage ADD COLUMN IF NOT EXISTS create_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE assistant_budget_usage ADD COLUMN IF NOT EXISTS modify_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP;
UPDATE assistant_budget_usage SET create_date = occurred_at, modify_date = occurred_at WHERE create_date IS DISTINCT FROM occurred_at OR modify_date IS DISTINCT FROM occurred_at;
+1 -1
View File
@@ -20,7 +20,7 @@
<!-- Multi-module build. The qqq-orb sets the revision here; the modules -->
<!-- inherit it, and the flatten plugin resolves it in the published POMs. -->
<properties>
<revision>0.4.0-SNAPSHOT</revision>
<revision>0.1.0-RC.33</revision>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -0,0 +1,63 @@
/*
* Copyright 2026 Kingsrook, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.kingsrook.qbits.assistant.metadata;
import java.util.List;
import com.kingsrook.qqq.backend.core.actions.customizers.AbstractPreInsertCustomizer;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
/*******************************************************************************
** For a table whose rows are written once and never change (a decision claim,
** a budget event): modifyDate equals createDate, exactly. QQQ's two date
** behaviors each read the clock on their own, so left alone the two values of
** one insert differ by a few microseconds. This runs after the behaviors and
** before the row is stored, and makes the second the same instant as the first.
*******************************************************************************/
public class AssistantInsertOnlyDatesCustomizer extends AbstractPreInsertCustomizer
{
/*******************************************************************************
** After the date behaviors ran (they run before the unique-key checks).
*******************************************************************************/
@Override
public WhenToRun getWhenToRun()
{
return (WhenToRun.BEFORE_UNIQUE_KEY_CHECKS);
}
/*******************************************************************************
** modifyDate = createDate on every record.
*******************************************************************************/
@Override
public List<QRecord> apply(List<QRecord> records) throws QException
{
for(QRecord record : records)
{
if(record.getValue("createDate") != null)
{
record.setValue("modifyDate", record.getValue("createDate"));
}
}
return (records);
}
}
@@ -165,6 +165,11 @@ public class AssistantMetaDataBuilder
{
List<QTableMetaData> tables = new ArrayList<>();
//////////////////////////////////////////////////////////////////////////////////
// tables whose rows are written once and never change: modifyDate = createDate //
//////////////////////////////////////////////////////////////////////////////////
QCodeReference insertOnlyDates = new QCodeReference(AssistantInsertOnlyDatesCustomizer.class);
QCodeReference conversationCustomizer = new QCodeReference(AssistantConversationCustomizer.class);
tables.add(owned(base(AssistantConversation.TABLE_NAME, "Assistant Conversation", "forum", AssistantConversation.class), false)
.withRecordLabelFormat("%s")
@@ -261,6 +266,7 @@ public class AssistantMetaDataBuilder
///////////////////////////////////////////////////////////////////////
tables.add(readOnly(owned(base(AssistantPendingActionClaim.TABLE_NAME, "Assistant Pending Action Claim", "task_alt", AssistantPendingActionClaim.class), false))
.withUniqueKey(new UniqueKey("pendingActionId"))
.withCustomizer(TableCustomizers.PRE_INSERT_RECORD, insertOnlyDates)
.withRecordLabelFormat("%s #%s").withRecordLabelFields("decision", "pendingActionId"));
tables.add(readOnly(owned(base(AssistantDataAudit.TABLE_NAME, "Assistant Data Audit", "shield", AssistantDataAudit.class), false))
@@ -301,6 +307,7 @@ public class AssistantMetaDataBuilder
.withCustomizer(TableCustomizers.PRE_UPDATE_RECORD, budgetCustomizer));
tables.add(readOnly(base(AssistantBudgetEvent.TABLE_NAME, "Budget Event", "notifications", AssistantBudgetEvent.class))
.withoutCapabilities(Capability.TABLE_DELETE)
.withCustomizer(TableCustomizers.PRE_INSERT_RECORD, insertOnlyDates)
.withUniqueKey(new UniqueKey("budgetId", "scopeKey", "periodStart", "state")));
tables.forEach(AssistantRecordScreens::apply);
return (tables);
@@ -59,6 +59,9 @@ public class AssistantBudgetEvent extends QRecordEntity
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
** Default constructor.
@@ -356,4 +359,35 @@ public class AssistantBudgetEvent extends QRecordEntity
return (this);
}
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantBudgetEvent withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -66,6 +66,12 @@ public class AssistantBudgetUsage extends QRecordEntity
@QField()
private Long cacheWriteTokens;
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
** Default constructor.
@@ -425,4 +431,66 @@ public class AssistantBudgetUsage extends QRecordEntity
return (this);
}
/*******************************************************************************
** Getter for createDate
*******************************************************************************/
public Instant getCreateDate()
{
return (this.createDate);
}
/*******************************************************************************
** Setter for createDate
*******************************************************************************/
public void setCreateDate(Instant createDate)
{
this.createDate = createDate;
}
/*******************************************************************************
** Fluent setter for createDate
*******************************************************************************/
public AssistantBudgetUsage withCreateDate(Instant createDate)
{
this.createDate = createDate;
return (this);
}
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantBudgetUsage withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -85,6 +85,9 @@ public class AssistantClientError extends QRecordEntity
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
@@ -631,4 +634,35 @@ public class AssistantClientError extends QRecordEntity
return (this);
}
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantClientError withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -72,6 +72,9 @@ public class AssistantDataAudit extends QRecordEntity
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
@@ -477,4 +480,33 @@ public class AssistantDataAudit extends QRecordEntity
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantDataAudit withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -61,6 +61,9 @@ public class AssistantFeedback extends QRecordEntity
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
@@ -328,4 +331,35 @@ public class AssistantFeedback extends QRecordEntity
return (this);
}
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantFeedback withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -50,6 +50,9 @@ public class AssistantPendingActionClaim extends QRecordEntity
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
@@ -224,4 +227,35 @@ public class AssistantPendingActionClaim extends QRecordEntity
return (this);
}
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantPendingActionClaim withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -109,6 +109,9 @@ public class AssistantToolCall extends QRecordEntity
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
@@ -837,4 +840,36 @@ public class AssistantToolCall extends QRecordEntity
this.clientChannel = clientChannel;
return (this);
}
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantToolCall withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -59,6 +59,9 @@ public class AssistantTurnEvent extends QRecordEntity
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
@@ -295,4 +298,35 @@ public class AssistantTurnEvent extends QRecordEntity
return (this);
}
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantTurnEvent withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -90,6 +90,9 @@ public class AssistantUsage extends QRecordEntity
@QField(isEditable = false)
private Instant createDate;
@QField(isEditable = false)
private Instant modifyDate;
/*******************************************************************************
@@ -698,4 +701,35 @@ public class AssistantUsage extends QRecordEntity
return (this);
}
/*******************************************************************************
** Getter for modifyDate
*******************************************************************************/
public Instant getModifyDate()
{
return (this.modifyDate);
}
/*******************************************************************************
** Setter for modifyDate
*******************************************************************************/
public void setModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
}
/*******************************************************************************
** Fluent setter for modifyDate
*******************************************************************************/
public AssistantUsage withModifyDate(Instant modifyDate)
{
this.modifyDate = modifyDate;
return (this);
}
}
@@ -0,0 +1,90 @@
/*
* Copyright 2026 Kingsrook, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.kingsrook.qbits.assistant;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.kingsrook.qbits.assistant.metadata.AssistantMetaDataBuilder;
import com.kingsrook.qbits.assistant.testing.BaseAssistantTest;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
/*******************************************************************************
** The reference DDL (docs/schema-postgres.sql) gives every table the QBit
** declares the columns create_date and modify_date, for a database made from
** it (the creates, then the later additions, as the file says). The
** PostgreSQL-only parts are run by SchemaForeignKeyPostgresTest.
*******************************************************************************/
class TableStandardSchemaTest extends BaseAssistantTest
{
/*******************************************************************************
** Every declared table has both columns after the reference DDL ran.
*******************************************************************************/
@Test
void everyDeclaredTableHasBothDateColumns() throws Exception
{
Set<String> declared = new HashSet<>();
for(QTableMetaData table : new AssistantMetaDataBuilder(config).buildTables())
{
declared.add(table.getName());
}
try(Connection connection = DriverManager.getConnection("jdbc:h2:mem:tablestandard" + System.nanoTime() + ";MODE=PostgreSQL;DEFAULT_NULL_ORDERING=HIGH"))
{
String ddl = Files.readString(Path.of("..", "docs", "schema-postgres.sql"), StandardCharsets.UTF_8);
Pattern pattern = Pattern.compile("^(CREATE TABLE|ALTER TABLE)( IF NOT EXISTS)? (assistant_[a-z_]+)\\b(.*)", Pattern.DOTALL);
try(Statement statement = connection.createStatement())
{
for(String sql : AssistantDefaultsChangelogTest.statements(ddl))
{
Matcher m = pattern.matcher(sql);
if(m.find() && (m.group(1).startsWith("CREATE") || m.group(4).strip().startsWith("ADD COLUMN")))
{
statement.execute(sql.replace("TIMESTAMPTZ", "TIMESTAMP WITH TIME ZONE"));
}
}
}
for(String table : declared)
{
Set<String> columns = new HashSet<>();
try(Statement statement = connection.createStatement(); ResultSet rs = statement.executeQuery("SELECT LOWER(column_name) FROM information_schema.columns WHERE LOWER(table_name) = '" + table + "'"))
{
while(rs.next())
{
columns.add(rs.getString(1));
}
}
assertThat(columns).as(table + " columns").contains("create_date", "modify_date");
}
}
}
}
@@ -0,0 +1,329 @@
/*
* Copyright 2026 Kingsrook, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.kingsrook.qbits.assistant.persistence;
import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDate;
import java.util.List;
import com.kingsrook.qbits.assistant.metadata.AssistantMetaDataBuilder;
import com.kingsrook.qbits.assistant.model.AssistantBudgetEvent;
import com.kingsrook.qbits.assistant.model.AssistantBudgetUsage;
import com.kingsrook.qbits.assistant.model.AssistantClientError;
import com.kingsrook.qbits.assistant.model.AssistantDataAudit;
import com.kingsrook.qbits.assistant.model.AssistantFeedback;
import com.kingsrook.qbits.assistant.model.AssistantPendingAction;
import com.kingsrook.qbits.assistant.model.AssistantPendingActionClaim;
import com.kingsrook.qbits.assistant.model.AssistantScheduledRun;
import com.kingsrook.qbits.assistant.model.AssistantToolCall;
import com.kingsrook.qbits.assistant.model.AssistantTurnEvent;
import com.kingsrook.qbits.assistant.model.AssistantUsage;
import com.kingsrook.qbits.assistant.model.AssistantUsageDaily;
import com.kingsrook.qbits.assistant.spi.ModelUsage;
import com.kingsrook.qbits.assistant.testing.AssistantTestFixture;
import com.kingsrook.qbits.assistant.testing.BaseAssistantTest;
import com.kingsrook.qqq.backend.core.context.QContext;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QCriteriaOperator;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.metadata.fields.DynamicDefaultValueBehavior;
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
/*******************************************************************************
** The table standard: every table the QBit declares has a createDate and a
** modifyDate (date-time, not editable, set by QQQ), and every write path of
** the store sets them: an insert sets both, an update moves modifyDate and
** leaves createDate. A row of a table that is only ever inserted (a log, an
** audit row, a claim) has a modifyDate equal to its createDate, always.
*******************************************************************************/
class TableStandardDatesTest extends BaseAssistantTest
{
private static final String USER = AssistantTestFixture.ADMIN;
/*******************************************************************************
** Every table the producer declares, found from the metadata and not listed
** by hand, has both dates as the standard says.
*******************************************************************************/
@Test
void everyDeclaredTableHasBothDates() throws Exception
{
List<QTableMetaData> declared = new AssistantMetaDataBuilder(config).buildTables();
assertThat(declared).hasSizeGreaterThan(20);
for(QTableMetaData declaredTable : declared)
{
QTableMetaData table = qInstance.getTable(declaredTable.getName());
assertThat(table).as(declaredTable.getName() + " is in the instance").isNotNull();
assertDate(table, "createDate", DynamicDefaultValueBehavior.CREATE_DATE);
assertDate(table, "modifyDate", DynamicDefaultValueBehavior.MODIFY_DATE);
}
}
/*******************************************************************************
**
*******************************************************************************/
private static void assertDate(QTableMetaData table, String name, DynamicDefaultValueBehavior behavior)
{
QFieldMetaData field = table.getFields().get(name);
assertThat(field).as(table.getName() + "." + name).isNotNull();
assertThat(field.getType()).as(table.getName() + "." + name + " type").isEqualTo(QFieldType.DATE_TIME);
assertThat(field.getIsEditable()).as(table.getName() + "." + name + " editable").isFalse();
assertThat(field.getBehaviors()).as(table.getName() + "." + name + " behaviors").contains(behavior);
}
/*******************************************************************************
** A usage counter row that is incremented moves its modifyDate each time.
*******************************************************************************/
@Test
void incrementedUsageCounterMovesModifyDate() throws Exception
{
AssistantStore store = store();
LocalDate day = LocalDate.of(2026, 1, 15);
ModelUsage usage = new ModelUsage();
store.addUsage(USER, day, usage, 10L, true);
AssistantUsageDaily first = store.getUserUsage(USER, day);
assertThat(first.getCreateDate()).isNotNull();
assertThat(first.getModifyDate()).isNotNull();
pause();
store.addUsage(USER, day, usage, 10L, true);
AssistantUsageDaily second = store.getUserUsage(USER, day);
assertThat(second.getTurnCount()).isEqualTo(2);
assertThat(second.getCreateDate()).isEqualTo(first.getCreateDate());
assertThat(second.getModifyDate()).isAfter(first.getModifyDate());
}
/*******************************************************************************
** Rows written once (a decision claim, a budget event) have modifyDate equal
** to createDate, exactly: QQQ's two behaviors read the clock separately, so
** the table's insert customizer makes them one instant. Rows of the tables
** that are inserted and, only when a transcript is redacted, rewritten, have
** both dates set, modifyDate not before createDate.
*******************************************************************************/
@Test
void insertOnlyRowsHaveEqualDates() throws Exception
{
AssistantStore store = store();
Instant now = Instant.parse("2026-02-03T04:05:06Z");
for(int i = 0; i < 20; i++)
{
AssistantBudgetEvent budgetEvent = store.insert(new AssistantBudgetEvent().withBudgetId(1).withScopeKey("k" + i).withPeriodStart(now).withState("WARN")
.withUsedValue(BigDecimal.ONE).withLimitValue(BigDecimal.TEN));
assertEqualDates(budgetEvent.getCreateDate(), budgetEvent.getModifyDate());
AssistantPendingActionClaim claim = store.insert(new AssistantPendingActionClaim().withPendingActionId(100 + i).withUserId(USER).withDecision("EXECUTED"));
assertEqualDates(claim.getCreateDate(), claim.getModifyDate());
}
AssistantTurnEvent event = store.insert(new AssistantTurnEvent().withTurnId(1).withUserId(USER).withSeq(1).withEventType("text.delta").withDataJson("{}"));
assertBothSet(event.getCreateDate(), event.getModifyDate());
AssistantFeedback feedback = store.insert(new AssistantFeedback().withUserId(USER).withRating(1));
assertBothSet(feedback.getCreateDate(), feedback.getModifyDate());
AssistantClientError error = store.insert(new AssistantClientError().withUserId(USER).withScope("test").withMessage("m"));
assertBothSet(error.getCreateDate(), error.getModifyDate());
AssistantDataAudit audit = store.insert(new AssistantDataAudit().withUserId(USER).withDecision("ALLOWED"));
assertBothSet(audit.getCreateDate(), audit.getModifyDate());
}
/*******************************************************************************
**
*******************************************************************************/
private static void assertBothSet(Instant createDate, Instant modifyDate)
{
assertThat(createDate).isNotNull();
assertThat(modifyDate).isNotNull().isAfterOrEqualTo(createDate);
}
/*******************************************************************************
** A decision of a pending action: the action moves its modifyDate, and the
** claim row is written once with equal dates.
*******************************************************************************/
@Test
void pendingActionDecisionMovesTheActionAndInsertsTheClaim() throws Exception
{
AssistantStore store = store();
Instant now = Instant.parse("2026-02-03T04:05:06Z");
AssistantPendingAction action = store.insert(new AssistantPendingAction().withUserId(USER).withToolName("update_record").withStatus(AssistantPendingAction.STATUS_PENDING));
assertThat(action.getCreateDate()).isNotNull();
assertThat(action.getModifyDate()).isNotNull();
pause();
assertThat(store.decidePendingAction(USER, action.getId(), AssistantPendingAction.STATUS_RUNNING, null, now)).isTrue();
AssistantPendingAction decided = store.getPendingAction(USER, action.getId());
assertThat(decided.getStatus()).isEqualTo(AssistantPendingAction.STATUS_RUNNING);
assertThat(decided.getCreateDate()).isEqualTo(action.getCreateDate());
assertThat(decided.getModifyDate()).isAfter(action.getModifyDate());
List<AssistantPendingActionClaim> claims = store.query(AssistantPendingActionClaim.TABLE_NAME,
new QQueryFilter().withCriteria("pendingActionId", QCriteriaOperator.EQUALS, action.getId()), AssistantPendingActionClaim.class);
assertThat(claims).hasSize(1);
assertEqualDates(claims.get(0).getCreateDate(), claims.get(0).getModifyDate());
pause();
store.finishPendingAction(action.getId(), AssistantPendingAction.STATUS_EXECUTED, 200, "done");
AssistantPendingAction finished = store.getPendingAction(USER, action.getId());
assertThat(finished.getCreateDate()).isEqualTo(action.getCreateDate());
assertThat(finished.getModifyDate()).isAfter(decided.getModifyDate());
}
/*******************************************************************************
** Clearing a tool call's result (the retention step) is an update.
*******************************************************************************/
@Test
void clearingAToolResultMovesModifyDate() throws Exception
{
AssistantStore store = store();
AssistantToolCall call = store.insert(new AssistantToolCall().withUserId(USER).withToolName("query_records").withResultJson("{}"));
assertThat(call.getCreateDate()).isNotNull();
assertThat(call.getModifyDate()).isNotNull();
pause();
assertThat(store.clearToolResultsBefore(Instant.now().plusSeconds(60), 10)).isEqualTo(1);
AssistantToolCall cleared = store.query(AssistantToolCall.TABLE_NAME, new QQueryFilter().withCriteria("id", QCriteriaOperator.EQUALS, call.getId()), AssistantToolCall.class).get(0);
assertThat(cleared.getResultJson()).isNull();
assertThat(cleared.getCreateDate()).isEqualTo(call.getCreateDate());
assertThat(cleared.getModifyDate()).isAfter(call.getModifyDate());
}
/*******************************************************************************
** A scheduled run is inserted when it is claimed and updated, as a whole
** entity, when it ends.
*******************************************************************************/
@Test
void scheduledRunUpdateMovesModifyDate() throws Exception
{
AssistantStore store = store();
AssistantScheduledRun run = store.insert(new AssistantScheduledRun().withTaskId(1).withUserId(USER).withScheduledFor(Instant.parse("2026-02-03T04:05:06Z")).withStatus("RUNNING"));
assertThat(run.getCreateDate()).isNotNull();
assertThat(run.getModifyDate()).isNotNull();
pause();
store.update(run.withStatus("SUCCEEDED"));
AssistantScheduledRun ended = store.query(AssistantScheduledRun.TABLE_NAME, new QQueryFilter().withCriteria("id", QCriteriaOperator.EQUALS, run.getId()), AssistantScheduledRun.class).get(0);
assertThat(ended.getStatus()).isEqualTo("SUCCEEDED");
assertThat(ended.getCreateDate()).isEqualTo(run.getCreateDate());
assertThat(ended.getModifyDate()).isAfter(run.getModifyDate());
}
/*******************************************************************************
** The budget accounting row is a projection of a usage row: written with
** the usage, and moved when the usage is updated.
*******************************************************************************/
@Test
void budgetProjectionFollowsItsUsageRow() throws Exception
{
AssistantStore store = store();
AssistantUsage usage = store.insert(new AssistantUsage().withUserId(USER).withModel("m").withCostMicros(5L));
assertThat(usage.getCreateDate()).isNotNull();
assertThat(usage.getModifyDate()).isNotNull();
AssistantBudgetUsage projection = projectionOf(store, usage);
assertThat(projection.getCreateDate()).isNotNull();
assertThat(projection.getModifyDate()).isNotNull();
pause();
store.updateFields(AssistantUsage.TABLE_NAME, new QRecord().withValue("id", usage.getId()).withValue("costMicros", 9L));
AssistantUsage updated = store.query(AssistantUsage.TABLE_NAME, new QQueryFilter().withCriteria("id", QCriteriaOperator.EQUALS, usage.getId()), AssistantUsage.class).get(0);
assertThat(updated.getCreateDate()).isEqualTo(usage.getCreateDate());
assertThat(updated.getModifyDate()).isAfter(usage.getModifyDate());
AssistantBudgetUsage moved = projectionOf(store, usage);
assertThat(moved.getCostMicros()).isEqualTo(9L);
assertThat(moved.getCreateDate()).isEqualTo(projection.getCreateDate());
assertThat(moved.getModifyDate()).isAfter(projection.getModifyDate());
}
/*******************************************************************************
**
*******************************************************************************/
private static AssistantBudgetUsage projectionOf(AssistantStore store, AssistantUsage usage) throws Exception
{
List<AssistantBudgetUsage> rows = store.query(AssistantBudgetUsage.TABLE_NAME, new QQueryFilter().withCriteria("usageId", QCriteriaOperator.EQUALS, usage.getId()), AssistantBudgetUsage.class);
assertThat(rows).hasSize(1);
return (rows.get(0));
}
/*******************************************************************************
**
*******************************************************************************/
private static void assertEqualDates(Instant createDate, Instant modifyDate)
{
assertThat(createDate).isNotNull();
assertThat(modifyDate).isNotNull().isEqualTo(createDate);
}
/*******************************************************************************
** The store, under an owner's session.
*******************************************************************************/
private AssistantStore store()
{
QContext.init(qInstance, AssistantTestFixture.ownerSession(USER, config));
return (config.getRuntime().getStore());
}
/*******************************************************************************
** Let the clock move, so a later write is told from an earlier one.
*******************************************************************************/
private static void pause() throws InterruptedException
{
Thread.sleep(25);
}
}