Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c12bb43
feat(sqlite): add transactional committed-event outbox and inbox store
Oct 15, 2026
e2950af
Capture authoritative graph mutations in SQLite outbox
Oct 15, 2026
5223153
Freeze Java committed update facts from transaction preimages
Oct 15, 2026
1413c33
Apply committed events through model-checked Java SQLite target
Oct 15, 2026
409a8c0
Replay shared committed Order fixture in Java target test
Oct 15, 2026
18850e2
Add durable ordered Java committed-event publication
Oct 15, 2026
b03a35d
Prove DuckDB JDBC adapter rolls back replica state atomically
Oct 15, 2026
e09249f
Add transaction-owned DuckDB committed Inbox core
Oct 15, 2026
842323e
feat(duckdb): apply committed graph facts through model-checked target
Oct 15, 2026
b37911e
test(duckdb): replay shared committed Order fixture
Oct 15, 2026
895d462
fix(duckdb): verify canonical relation indexes on repeated schema
Oct 15, 2026
1a073c5
Validate committed-event trace wire nodes
Oct 15, 2026
9580529
Encode committed integral fields losslessly
Oct 15, 2026
25e2368
Validate committed calendar dates across runtimes
Oct 15, 2026
a034eb0
Reject inexact SQLite decimal replication
Oct 15, 2026
5f185b7
Qualify committed scalar and null wire kinds
Oct 15, 2026
6ec1f4f
Qualify committed nullable field transitions
Oct 15, 2026
26d4b75
Qualify committed absolute instant codec on SQLite
Oct 15, 2026
d3f89cc
Reject unmodeled and out-of-range replicated Decimal values
Oct 15, 2026
e1ac957
Exercise committed SQLite-to-DuckDB delivery in runtime example
Oct 17, 2026
35abd82
Verify committed DuckDB target through generated Q API
Oct 17, 2026
6c85892
Prove ordered lost-ack recovery in committed example
Oct 17, 2026
7cfe9ff
Reject duplicate inbox after target checkpoint rewind
Oct 18, 2026
7f99d1e
Keep nested JDBC save failures rollback-only
Oct 18, 2026
b81d975
Mark JDBC transaction rollback-only after caught SQL failures
Oct 18, 2026
54d0f11
Rollback JDBC transaction after caught mapper failures
Oct 18, 2026
9389407
fix: distinguish post-commit audit delivery failures
Oct 18, 2026
628991a
fix: classify committed graph reconciliation failures
Oct 18, 2026
092e483
fix: deliver committed audits after reconciliation failure
Oct 18, 2026
be9f94e
Merge remote-tracking branch 'origin/fix/committed-postcommit-reconci…
Oct 19, 2026
46f6c73
fix: preserve committed outcome after JDBC cleanup failure
Oct 19, 2026
4577185
fix: distinguish unknown JDBC transaction outcomes
Oct 19, 2026
dee5bbe
fix: fence graph after unconfirmed rollback of JVM Error
Oct 19, 2026
dd32106
fix: fence unknown rollback without suppressed Error metadata
Oct 19, 2026
edbae2b
fix: fence JDBC Error outcomes and preserve committed cleanup
Oct 19, 2026
8135bcf
fix(jdbc): avoid unsafe close after unconfirmed rollback
Oct 19, 2026
5ba882c
test(jdbc): cover confirmed rollback retry before close
Oct 20, 2026
f61d8bd
[skip ci] Integrate approved post-commit reconciliation into audit fix
Oct 21, 2026
cdc8a1c
[skip ci] Integrate approved post-commit audit and reconciliation fixes
Oct 21, 2026
c2c6d12
[skip ci] Integrate approved JDBC transaction outcome and cleanup fixes
Oct 21, 2026
e88defb
[skip ci] test: prove post-commit source-process crash recovery twice
Oct 21, 2026
31938f8
[skip ci] test: prove mixed target operations rollback retry and dedu…
Oct 21, 2026
a06b309
[skip ci] test: reject an unknown target entity before applying facts…
Oct 21, 2026
aeabee8
[skip ci] test: prove numbered HTTP limits and recovery boundaries (#…
Oct 21, 2026
dcd6c3a
[skip ci] test: prove signed SDK coexistence and repeat one HTTP fixt…
Oct 21, 2026
40c6013
[skip ci] test: gate stalled response expiry on a physical POST witne…
Oct 21, 2026
db11717
[skip ci] test: preserve native exit status while retaining failed re…
Oct 21, 2026
94d7bc2
[skip ci] test: honor captured JDK wait budgets in the stalled POST f…
Oct 21, 2026
0ba2e81
[skip ci] Integrate governed CMR-03 process crash example (#247)
Oct 21, 2026
b9643f4
[skip ci] Integrate mixed target atomicity and strict model tests (#249)
Oct 21, 2026
c942d2f
[skip ci] Integrate numbered HTTP boundaries and SDK isolation (#251)
Oct 21, 2026
56f6e4c
[skip ci] Isolate profile-scoped CA trust and prove HTTPS rotation (#…
Oct 21, 2026
555f7a3
[skip ci] Keep the TLS test peer within existing JPMS dependencies (#…
Oct 21, 2026
e5b4393
test: deny business Context APIs during committed target apply [skip ci]
Oct 21, 2026
0f7b48b
feat: add model-aware SQLite snapshot bootstrap and strict tail bound…
Oct 21, 2026
500a549
example: demonstrate consistent legacy snapshot and portable tail [sk…
Oct 21, 2026
0066413
test(sqlite): reject invalid snapshot authority and conflicting retri…
Oct 21, 2026
e1d3be1
feat(sqlite): retain bootstrap publications and fence cursor initiali…
Oct 21, 2026
8acdd1a
test(sqlite): exercise managed bootstrap across owned process crashes…
Oct 21, 2026
1a0018f
test(sqlite): retain crash-boundary readbacks and flush ready diagnos…
Oct 21, 2026
09c029d
test: define authenticated committed receiver contract (CMR-13 RED) […
Oct 22, 2026
8d0ccbd
feat: authenticate committed delivery and persist safe rejection audi…
Oct 22, 2026
ba81754
test: define authenticated snapshot ingress and cross-kind controls (…
Oct 22, 2026
c80a8d0
feat: authenticate bounded snapshot ingress with separate signature d…
Oct 22, 2026
0d4cd02
fix: keep bootstrap replacement explicit and startup-owned for receiv…
Oct 22, 2026
e132833
test: add audited authenticated snapshot-tail example [skip ci]
Oct 22, 2026
ff0e699
test: keep large identifiers exact in example receipts [skip ci]
Oct 22, 2026
0d3bbe3
test: match namespaced snapshot audit code in example [skip ci]
Oct 22, 2026
7374e5e
test: specify durable CMR-14 delivery observations (RED) [skip ci]
Oct 22, 2026
656c920
feat: persist delivery observations and atomic acknowledgement journa…
Oct 22, 2026
60035ac
test: cover permanent rejection snapshot stale ACK and safe target te…
Oct 22, 2026
28261f6
fix: preserve rejection reason across retries and check observation i…
Oct 22, 2026
0ee4f61
test: observe real signed snapshot-tail delivery and lost acknowledge…
Oct 22, 2026
1123c08
test: specify strict committed control-frame boundaries (RED) [skip ci]
Oct 22, 2026
f975332
fix: reject unknown replication protocol controls without inspecting …
Oct 22, 2026
3e8bc36
test: reject replication controls at ordinary TFP entries [skip ci]
Oct 22, 2026
a96ea12
test: cover signed snapshot protocol controls (RED) [skip ci]
Oct 22, 2026
9dc9e41
fix: reject noncanonical signed snapshot controls [skip ci]
Oct 22, 2026
849c194
test: require ordinary analytical-target mutations to be read-only (R…
Oct 22, 2026
f236ca9
test: repair read-only probe API wiring before RED qualification [ski…
Oct 22, 2026
be8f8e3
fix: separate target replication authority from ordinary JDBC mutatio…
Oct 22, 2026
b91d509
test: preserve target reads and deny dynamic JDBC writes [skip ci]
Oct 22, 2026
b607512
test: demonstrate generated audited-save denial on analytical targets…
Oct 22, 2026
10c7fce
test: exercise actual TFP reads and denied writes on a signed SQLite …
Oct 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ Request JSON is not allowed to replace those trusted capabilities.
- [Shared load state](examples/shared-load-state/README.md)
- [Binary object storage and temporary S3 URLs](examples/object-storage/README.md)
- [Context-owned HTTP with bounded retries and safe diagnostics](examples/http-resilience/README.md)
- [Transactional committed-event Outbox from a real SQLite graph save](examples/committed-events/README.md)
- [Extension points](https://github.com/teaql/teaql-conformance/blob/main/design/runtime-customization-p0-p1-matrix.md)

## Safe troubleshooting
Expand Down
143 changes: 143 additions & 0 deletions examples/committed-events/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# SQLite committed-event source example

## Durable observations (CMR-14)

The same security verifier records nine phases in `observations.json` using
public Context-participating source/target observation APIs. It intentionally
loses both snapshot and tail receipts **after actual target commit**. Target
watermark advances while source ACK/backlog stay behind; duplicate retry then
converges. Two durable journal rows retain six attempts, four retries/failures
and two publisher-observed permanent rejections. Target-wide audit counts five
rejections, including direct unauthorized-source attempts. Final dead letters
are zero, not deleted source facts. Typed observations and existing runtime
telemetry agree; exported attributes contain only counts and hashed routes.
No fake ACK, transport authentication claim or automatic retry worker is used.

## Authenticated snapshot and tail (CMR-13)

`bash examples/committed-events/verify-security.sh` executes the local runtime
example twice; the complete verifier includes it. Two audited Mutation saves,
not INSERT fixtures, produce baseline 1 and tail 2. A retained signed snapshot
bootstraps an independent target. A lost snapshot receipt leaves the source
cursor pending; retry gets a stable duplicate receipt. The signed update then
catches up without rerunning business methods. A source ID above JavaScript's
exact-integer range survives unchanged.

Five real rejections cover bad snapshot tag, tampered tail with recomputed
checksum, unauthorized source, replay of snapshot-covered history and a newer
snapshot attempting to reset an active stream. Checks inspect rows, source
cursor, Inbox, checkpoint and durable hash-only audit, including a fresh target
Context/connection. Exact event/snapshot retries do not rewind the tail.

Builds and disposable fixtures are removed on exit. Explicitly set
`TEAQL_CMR13_EVIDENCE_ROOT` to an absent absolute path to retain two small
SQLite pairs, result JSON and native logs/JUnit. For the complete gate,
`TEAQL_COMMITTED_EVIDENCE_DIR` similarly opts into retaining generated Q proof.
Never reuse/reset these directories. The key is public test material, not a
deployment secret. This is authenticated in-process ingress, not a network/TLS
server, receipt authentication, installed-package or production qualification.

## Existing source and target flows

Run `bash examples/committed-events/verify.sh`. It executes a small, real
`Order.save(context)` flow twice against a local Java source. Each round uses
fresh source/target SQLite files and an independent DuckDB target. The test
reopens the Outbox, delivers the two events through bounded publishers into
both model-checked targets, verifies their rows and the SQLite target duplicate
acknowledgement, then injects a later source write failure. The first SQLite
delivery deliberately loses its acknowledgement after target commit; a new
source executor replays sequence 1 as a duplicate and then applies sequence 2
in order. This small fixture
itself requires no generated ERP model or remote service.

The example configures `SqliteCommittedMutationRecorder` at trusted runtime
startup; `context.ensureSchema()` installs its infrastructure tables. A database trigger
sets `memo` after insert; the Outbox contains that authoritative readback, not
the pre-save entity value. Subsequent update produces sequence 2. When the
Outbox table is made unavailable, the attempted third save rolls back its
business update and emits no committed event.

This is **not** authenticated network replication. The in-process sinks prove
local cursor/target behavior; transport identity, retry budgets, snapshot-plus-
tail and dynamic fields remain separate work. The included typed wire tests
cover selected scalar, null, date, instant and Decimal boundaries, not every
possible model type.

The verifier also runs an application-owned generated Standard Order consumer
twice. It creates a Customer through generated audited Save on SQLite, delivers
one committed set to a model-checked DuckDB target, and reads the target through
generated Q. The checked-in generated library remains byte-for-byte unchanged;
public-package and production-network qualification are separate.

## Real source-process crash (CMR-03)

`bash examples/committed-events/verify-process-crash.sh` runs a separate bounded
fixture (also included by the complete verifier above). An actual child performs
a normal audited save, signals a post-commit/pre-publish barrier, and waits with
the runtime still open. Its owning test forcibly terminates and reaps it. A new
process recovers the durable Outbox, lands the event, simulates a lost target
acknowledgement, accepts the duplicate receipt and advances the source cursor.
A third process checks persistent rows, versions, Inbox and cursor again.

The same source/target files are used for both rounds: their row/event/cursor
counts go from one to two, not back to zero. A business-invocation marker also
stays one-per-writer, not one-per-delivery. A negative control rejects normal
exit without a ready marker. Logs and waits are bounded; only owned children
are killed. No production callback, HTTP endpoint or new runtime API is added.

Set `TEAQL_CMR03_EVIDENCE_DIR` to a **fresh** directory to retain the two small
databases, child logs, barriers and `result.json` at a known location. By default
an owned temporary evidence directory is printed and retained. Never delete or
reset a previous database to force success. Module `target` directories remain
ordinary reusable Maven build outputs; one-off gate owners clean their own
build directories after recording results. This proves controlled process death,
not machine/power failure, snapshot restart, all CMR-12 paths or public artifacts.

## Consistent snapshot plus tail (CMR-11)

Run `bash examples/committed-events/verify-snapshot.sh`. It copies the current
local source without build outputs, runs `CommittedSnapshotExampleTest` twice
offline and deletes its owned build/database scratch on exit. It never selects
a released runtime. The complete verifier also invokes this gate.

The small fixture has two legacy orders (including a tombstone and an ID above
JavaScript's exact-integer range), a negative epoch timestamp, Boolean/NULL and
an empty entity catalog entry. Context `ensureSchema` creates its schema;
explicit fixture SQL represents old data with no captured journal. A separate
transaction simulates one captured tail. Actual business audited-save capture
remains demonstrated by `CommittedEventsExampleTest`, not by this fixture SQL.

The example imports snapshot N=0, applies tail 1, retries both and proves that a
snapshot retry acknowledges 0 without rewinding checkpoint 1. Optional
`TEAQL_SNAPSHOT_EXPORT_DIR` writes only `snapshot.json`, `tail.json` and their
SHA-256 sidecars with create-new semantics. `TEAQL_SNAPSHOT_IMPORT_DIR` consumes
the same files, including those exported by the Rust example. Use separate
producer/consumer runs and fresh owned export directories; never overwrite old
evidence. These files do not define an authenticated network transport. No
CMR-12 process-crash or production-scale qualification is claimed.

## Managed bootstrap process recovery (CMR-12 candidate)

`bash examples/committed-events/verify-bootstrap-crash.sh` copies the **local**
source, compiles it offline and runs the process example twice. Each invocation
keeps one source database throughout two rounds (snapshot/tail 1/2, then 3/4).
The second target is a new consumer slot, not a reset database. The first target
then catches up to 4 without replacing its original snapshot or rewinding its
cursor. Ordinary business writes use audited saves; one retained legacy
tombstone predates capture.

In each round the owner SIGKILLs and reaps seven distinct workers: during the
capture read transaction, publication retention, partial target installation,
after target commit/before snapshot receipt, between source cursor insert and
ACK commit, partial tail application, and after tail commit/before event receipt.
Fresh workers recover from the same files. SQL barriers exist only in this
test fixture; production has no fault hook. A normal exit without the expected
PID/phase barrier is rejected. Waits and logs are bounded.

Set `TEAQL_CMR12_EVIDENCE_ROOT` to a **nonexistent absolute path** to retain
compact databases, child logs, PID barriers, JUnit XML and `result.json` for both
invocations. No existing path is reset. Otherwise successful disposable test
fixtures are removed after all owned workers exit; failed fixtures print their
diagnostic location. Temporary source/build outputs are removed by the verifier
on exit. This controlled Linux/SQLite **source** example is not installed-package,
power-loss, authenticated transport or whole-CMR-12 acceptance.
21 changes: 21 additions & 0 deletions examples/committed-events/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.teaql</groupId><artifactId>teaql-java-parent</artifactId>
<version>1.555-RELEASE</version><relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>teaql-committed-events-example</artifactId>
<dependencies>
<dependency><groupId>io.teaql</groupId><artifactId>teaql-tfp-endpoint</artifactId><version>${project.version}</version><scope>test</scope></dependency>
<dependency><groupId>io.teaql</groupId><artifactId>teaql-runtime</artifactId></dependency>
<dependency><groupId>io.teaql</groupId><artifactId>teaql-sqlite</artifactId></dependency>
<dependency><groupId>io.teaql</groupId><artifactId>teaql-duckdb</artifactId><version>${project.version}</version></dependency>
<dependency><groupId>io.teaql</groupId><artifactId>teaql-provider-jdbc</artifactId></dependency>
<dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId></dependency>
<dependency><groupId>org.xerial</groupId><artifactId>sqlite-jdbc</artifactId><version>3.53.2.1</version></dependency>
<dependency><groupId>org.duckdb</groupId><artifactId>duckdb_jdbc</artifactId><version>1.5.5.1</version></dependency>
<dependency><groupId>junit</groupId><artifactId>junit</artifactId><scope>test</scope></dependency>
</dependencies>
</project>
Loading