hawdb 0.41.0

An embedded Rust graph database for local data-plane workloads
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
name: Weekly Platform CI

on:
  workflow_dispatch:
    inputs:
      scope:
        description: Qualification lanes to run; partial scopes do not qualify other lanes
        type: choice
        options: [all, runtime, power-loss]
        default: all
  schedule:
    # Scheduled workflows run the latest revision of the default branch (main).
    - cron: "37 3 * * 1"

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}${{ inputs.scope && inputs.scope != 'all' && format('-{0}', inputs.scope) || '' }}
  cancel-in-progress: true

defaults:
  run:
    # Stop at the first failed native command on Windows as well as Unix.
    shell: bash

jobs:
  runtime-platform:
    if: ${{ inputs.scope != 'power-loss' }}
    name: Runtime Platform (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        # Linux coverage is authoritative in the Prow Bazel build and crate-test jobs.
        os: [macos-latest, windows-latest]
    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Install Rust
        uses: dtolnay/rust-toolchain@1.99.1

      - name: Check Tokio facade
        run: cargo check -p hawdb --features tokio-runtime

      - name: Check qualification workload
        run: cargo check -p hawdb-qualification

      - name: Test resource detection
        run: cargo test -p hawdb-qos resource::tests

      - name: Test cgroup v2 detection
        run: cargo test -p hawdb-cgroup

      - name: Test expression IR
        run: cargo test -p hawdb-expression

      - name: Test telemetry contract
        run: cargo test -p hawdb-telemetry

      - name: Test process memory metrics
        run: cargo test -p hawdb-qos process_memory::tests

      - name: Test embedded process RSS admission and native recovery
        run: |
          cargo clippy --locked -p hawdb --features tokio-runtime --test process_memory_policy_contract -- -D warnings
          cargo test --locked -p hawdb --features tokio-runtime --test process_memory_policy_contract -- --nocapture

      - name: Test Tokio adapter
        run: cargo test -p hawdb-runtime-tokio

      - name: Test admitted planning
        run: cargo test -p hawdb --features tokio-runtime --lib api::query_runtime::tests

      - name: Test synchronous query entrypoints
        run: cargo test -p hawdb --features tokio-runtime --lib embedded::tests

      - name: Test native indexed node view ownership
        run: cargo test --locked -p hawdb --features tokio-runtime --lib api::retained_query::node::tests -- --nocapture

      - name: Test immutable catalog symbol ownership
        run: cargo test --locked -p hawdb-core --lib schema::tests

      - name: Test request context constraints
        run: |
          cargo test --locked -p hawdb-core --lib cancellation::

      - name: Test shared query request contracts
        run: |
          cargo test --locked -p hawdb --lib api::query_request::
          cargo test --locked -p hawdb --features acl --lib api::query_request::

      - name: Test prepared source admission and private query fixtures
        run: |
          bash scripts/cargo-test-required.sh --locked -p hawdb --lib api::dependency_read::tests::prepared_source_queries_preserve_task_result_limits_and_cancellation
          bash scripts/cargo-test-required.sh --locked -p hawdb --lib api::sql_runtime::tests::
          bash scripts/cargo-test-required.sh --locked -p hawdb --lib api::tests::knowledge_entity_deletes::
          bash scripts/cargo-test-required.sh --locked -p hawdb --lib graph_route_evidence::
          bash scripts/cargo-test-required.sh --locked -p hawdb-readiness --lib graph_route_catalog::tests::

      - name: Test borrowed result delivery
        run: |
          cargo test --locked -p hawdb-executor --lib result_delivery::tests::borrowed::
          cargo test --locked -p hawdb-executor --lib numeric::
          cargo test --locked -p hawdb --lib api::tests::query_execution::read_transaction_exposes_validated_compact_borrowed_rows
          cargo test --locked -p hawdb --lib api::tests::query_execution::read_transaction_borrowed_stream_refuses_limits_without_delivering_a_prefix
          cargo test --locked -p hawdb --lib api::tests::query_execution::native_numeric_results_preserve_borrowing_validation_and_owned_parity

      - name: Test Tokio query entrypoints
        run: |
          cargo test --locked -p hawdb --features tokio-runtime --lib embedded_tokio::
          cargo test --locked -p hawdb --features tokio-runtime,acl --lib embedded_tokio::request_tests

      - name: Test Mem shared publication ownership
        run: |
          cargo test --locked -p hawdb --features tokio-runtime --lib api::concurrent::autocommit::tests::
          bash scripts/cargo-test-required.sh --locked -p hawdb --features tokio-runtime --lib api::concurrent::autocommit::sql::tests::
          cargo test --locked -p hawdb --features tokio-runtime --lib api::concurrent::graph_preparation_tests::
          cargo test --locked -p hawdb --features tokio-runtime --lib embedded_store::concurrent_owner::
          cargo test --locked -p hawdb --features tokio-runtime --lib embedded_store::read_execution::
          cargo test --locked -p hawdb --features tokio-runtime --lib embedded_store::app_read_snapshot_tests

  vector-projection-platform:
    if: ${{ !inputs.scope || inputs.scope == 'all' }}
    name: Vector Projection (${{ matrix.target }})
    runs-on: ${{ matrix.runner }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: linux-x86_64
            runner: ubuntu-24.04
          - target: linux-aarch64
            runner: ubuntu-24.04-arm
          - target: macos-aarch64
            runner: macos-15
          - target: windows-x86_64
            runner: windows-2025
    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Install Rust
        uses: dtolnay/rust-toolchain@1.99.1

      - name: Check default and minimal feature sets
        run: |
          cargo check -p hawdb
          cargo check -p hawdb --no-default-features

      - name: Test search capability feature combinations
        shell: bash
        run: |
          set -euo pipefail
          # Preserve native Windows namespace/handle qualification isolation.
          # Changing this lane's concurrency requires separate native evidence.
          if [[ "$RUNNER_OS" == "Windows" ]]; then
            export RUST_TEST_THREADS=1
          fi
          cargo test -p hawdb-search
          cargo test -p hawdb-search --no-default-features
          cargo test -p hawdb-search --no-default-features --features full-text-search
          cargo test -p hawdb-search --no-default-features --features vector-search
          cargo test -p hawdb-search --no-default-features --features background-maintenance
          cargo test -p hawdb-search --no-default-features --features full-text-search,vector-search
          cargo test -p hawdb-search --no-default-features --features full-text-search,background-maintenance
          cargo test -p hawdb-search --no-default-features --features vector-search,background-maintenance

      - name: Test RaBitQ projection
        run: cargo test -p hawdb-vector-projection

      - name: Test admitted RaBitQ artifact IO
        shell: bash
        run: |
          cargo test --locked -p hawdb-vector-projection --features storage-io
          bash scripts/cargo-test-required.sh --locked -p hawdb-vector-projection --features storage-io --lib artifact::descriptor_tests::

      - name: Test RaBitQ search projection
        shell: bash
        run: |
          bash scripts/cargo-test-required.sh --locked -p hawdb-search --lib rabitq_projection::tests

      - name: Test vector qualification protocol
        run: cargo test -p hawdb-qualification production_vector

  storage-platform:
    if: ${{ !inputs.scope || inputs.scope == 'all' }}
    name: Storage Platform (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [macos-latest, windows-latest]
    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Install Rust
        uses: dtolnay/rust-toolchain@1.99.1

      - name: Test storage artifacts and ownership
        run: cargo test -p hawdb-storage

      - name: Test ordinary project opening and pending recovery
        shell: bash
        run: |
          set -euo pipefail
          # Until #819 isolates Windows alias probes, exhausted project fixtures
          # must not overlap unrelated existing-project admission.
          if [[ "$RUNNER_OS" == "Windows" ]]; then
            export RUST_TEST_THREADS=1
          fi
          bash scripts/cargo-test-required.sh --locked -p hawdb --test branch_project_open
          bash scripts/cargo-test-required.sh --locked -p hawdb --no-default-features --test branch_project_open

      - name: Test branch lifecycle and creation retries
        shell: bash
        run: |
          bash scripts/cargo-test-required.sh --locked -p hawdb --features acl --lib api::branch_lifecycle::tests::

      - name: Test durable storage recovery
        run: cargo test -p hawdb --features acl --lib api::tests::storage_recovery

      - name: Test row-page compaction and reclamation
        shell: bash
        run: bash scripts/cargo-test-required.sh --locked -p hawdb --features acl --test row_page_compaction

      - name: Test out-of-core search projection I/O
        shell: bash
        run: |
          set -euo pipefail
          # Until #819 isolates Windows alias probes, exhausted project fixtures
          # must not overlap unrelated existing-project admission.
          if [[ "$RUNNER_OS" == "Windows" ]]; then
            export RUST_TEST_THREADS=1
          fi
          bash scripts/cargo-test-required.sh --locked -p hawdb-search --features acl --lib out_of_core::
          bash scripts/cargo-test-required.sh --locked -p hawdb-search --features acl --test generation_source_policy

      - name: Capture Windows storage lifecycle evidence
        if: matrix.os == 'windows-latest'
        shell: bash
        env:
          HAWDB_TEST_RUST_TOOLCHAIN: "1.99.1"
          HAWDB_TEST_STORAGE_RESOURCE_EVIDENCE_PATH: storage-resource-results/report.json
        run: |
          set -euo pipefail
          mkdir -p storage-resource-results
          set +e
          cargo test -p hawdb --features acl --lib \
            api::tests::storage_recovery::platform_storage_resource_profile_emits_bound_evidence \
            -- --exact --nocapture 2>&1 \
            | tee storage-resource-results/resource-profile-test-output.txt
          resource_status=${PIPESTATUS[0]}
          cargo test -p hawdb --features acl --lib \
            api::tests::storage_recovery::canonical_row_overflow_backup_reopen_and_reclaim_follow_physical_closure \
            -- --exact --nocapture 2>&1 \
            | tee storage-resource-results/row-overflow-lifecycle-test-output.txt
          lifecycle_status=${PIPESTATUS[0]}
          set -e
          printf '{"protocol":"hawdb-windows-storage-lifecycle-evidence-v1","source_revision":"%s","runner_os":"%s","resource_profile_test_status":%s,"row_overflow_lifecycle_test_status":%s}\n' \
            "$GITHUB_SHA" "$RUNNER_OS" "$resource_status" "$lifecycle_status" \
            > storage-resource-results/manifest.json
          test "$resource_status" -eq 0
          test "$lifecycle_status" -eq 0

      - name: Upload Windows storage lifecycle evidence
        if: always() && matrix.os == 'windows-latest'
        uses: actions/upload-artifact@v7
        with:
          name: storage-resource-windows-latest-${{ github.sha }}
          path: storage-resource-results
          if-no-files-found: error

  branch-power-loss:
    if: ${{ inputs.scope != 'runtime' }}
    name: Branch Power Loss (${{ matrix.os }}, ${{ matrix.shard }})
    runs-on: ${{ matrix.os }}
    timeout-minutes: 120
    strategy:
      fail-fast: false
      matrix:
        # Native execution checks the implementation under explicit barrier
        # assumptions; it does not certify Windows directory-flush semantics.
        include:
          - os: ubuntu-24.04
            shard: full
          - os: macos-latest
            shard: full
          - os: windows-latest
            shard: head-every-write
          - os: windows-latest
            shard: head-checkpoint
          - os: windows-latest
            shard: manifest-every-write
          - os: windows-latest
            shard: manifest-checkpoint
          - os: windows-latest
            shard: root-every-write
          - os: windows-latest
            shard: root-checkpoint
          - os: windows-latest
            shard: wal-sync-every-write
          - os: windows-latest
            shard: wal-sync-checkpoint
          - os: windows-latest
            shard: remaining
          - os: windows-latest
            shard: consumer-publication
          - os: windows-latest
            shard: search-publication
          - os: windows-latest
            shard: branch-gc
          - os: windows-latest
            shard: abandonment
          - os: windows-latest
            shard: recovery-births
          - os: windows-latest
            shard: recovery-unselected
          - os: windows-latest
            shard: recovery-selected
          - os: windows-latest
            shard: recovery-lost-sql-link
          - os: windows-latest
            shard: recovery-lost-sql-selector
          - os: windows-latest
            shard: recovery-lost-nodes-link
          - os: windows-latest
            shard: recovery-lost-nodes-selector
          - os: windows-latest
            shard: publication-artifacts
          - os: windows-latest
            shard: publication-selectors
          - os: windows-latest
            shard: publication-barriers
    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Install Rust
        uses: dtolnay/rust-toolchain@1.99.1

      - name: Run branch power-loss qualification
        shell: bash
        env:
          POWER_LOSS_SHARD: ${{ matrix.shard }}
        run: |
          set -euo pipefail
          python3 scripts/branch-power-loss-shard.test.py
          mkdir -p branch-power-loss-results
          git rev-parse HEAD > branch-power-loss-results/source-revision.txt
          rustc --version --verbose > branch-power-loss-results/toolchain.txt
          uname -a > branch-power-loss-results/platform.txt
          df -Pk . "${TMPDIR:-/tmp}" > branch-power-loss-results/disk-before.txt
          cargo test --locked -p hawdb-storage --all-features --lib \
            power_loss:: -- --list 2>&1 \
            | tee branch-power-loss-results/recorder-discovery.txt
          cargo test --locked -p hawdb --all-features --lib \
            api::tests::power_loss:: -- --list 2>&1 \
            | tee branch-power-loss-results/discovery.txt
          python3 scripts/branch-power-loss-shard.py \
            --discovery branch-power-loss-results/discovery.txt \
            --shard "$POWER_LOSS_SHARD" --output-dir branch-power-loss-results
          test_filter=$(cat branch-power-loss-results/test-filter.txt)
          test_arguments=(--nocapture --test-threads=1)
          while IFS= read -r argument; do
            test_arguments+=("$argument")
          done < branch-power-loss-results/test-arguments.txt
          set +e
          bash scripts/cargo-test-required.sh --locked -p hawdb-storage --all-features --lib \
            power_loss:: -- --nocapture --test-threads=1 2>&1 \
            | tee branch-power-loss-results/recorder-output.txt
          recorder_status=$?
          if [[ "$RUNNER_OS" == Windows ]]; then
            # Surface configuration failures before the long publication matrix.
            bash scripts/cargo-test-required.sh --locked -p hawdb --all-features --lib \
              api::tests::power_loss::schema_indexes_and_nested_data_survive_power_loss_in_configured_residencies \
              -- --exact --nocapture --test-threads=1 2>&1 \
              | tee branch-power-loss-results/configuration-output.txt
            configuration_status=$?
            if (( configuration_status != 0 )); then
              exit "$configuration_status"
            fi
          fi
          bash scripts/cargo-test-required.sh --locked -p hawdb --all-features --lib \
            "$test_filter" -- "${test_arguments[@]}" 2>&1 \
            | tee branch-power-loss-results/test-output.txt
          test_status=$?
          if [[ "$test_status" -eq 0 ]]; then
            recovery_scope=remaining
            automatic_scope=remaining
            case "$POWER_LOSS_SHARD" in
              recovery-*|full) recovery_scope="$POWER_LOSS_SHARD" ;;
            esac
            case "$POWER_LOSS_SHARD" in
              head-*|root-*|wal-sync-*|manifest-*|full) automatic_scope="$POWER_LOSS_SHARD" ;;
            esac
            python3 scripts/vector_recovery_cases.py "$recovery_scope" \
              --validate-log branch-power-loss-results/test-output.txt \
              > branch-power-loss-results/recovery-coverage.json
            test_status=$?
            if [[ "$test_status" -eq 0 ]]; then
              python3 scripts/automatic_checkpoint_cases.py "$automatic_scope" \
                --validate-log branch-power-loss-results/test-output.txt \
                > branch-power-loss-results/automatic-coverage.json
              test_status=$?
            fi
          fi
          set -e
          df -Pk . "${TMPDIR:-/tmp}" > branch-power-loss-results/disk-after.txt
          namespace_assumption=posix-directory-sync
          if [[ "$RUNNER_OS" == Windows ]]; then
            namespace_assumption=windows-directory-flush-unqualified
          fi
          printf '{"protocol":"hawdb-branch-power-loss-ci-v1","source_revision":"%s","runner_os":"%s","test_status":%s,"recorder_status":%s,"namespace_assumption":"%s","physical_device_test":false}\n' \
            "$GITHUB_SHA" "$RUNNER_OS" "$test_status" "$recorder_status" "$namespace_assumption" \
            > branch-power-loss-results/manifest.json
          if (( recorder_status != 0 )); then
            exit "$recorder_status"
          fi
          exit "$test_status"

      - name: Record Windows filesystem context
        if: always() && matrix.os == 'windows-latest'
        shell: pwsh
        run: |
          New-Item -ItemType Directory -Force branch-power-loss-results | Out-Null
          $roots = @{
            workspace = $env:GITHUB_WORKSPACE
            temporary = [System.IO.Path]::GetTempPath()
          }
          $volumes = foreach ($entry in $roots.GetEnumerator()) {
            $directory = Get-Item -LiteralPath $entry.Value -ErrorAction Stop
            $volume = Get-Volume -DriveLetter $directory.PSDrive.Name -ErrorAction Stop
            [ordered]@{
              scope = $entry.Key
              path = $directory.FullName
              filesystem = $volume.FileSystem
              drive_type = "$($volume.DriveType)"
              allocation_unit_size = $volume.AllocationUnitSize
              size = $volume.Size
              size_remaining = $volume.SizeRemaining
            }
          }
          [ordered]@{
            source_revision = $env:GITHUB_SHA
            os = Get-CimInstance Win32_OperatingSystem |
              Select-Object Caption, Version, BuildNumber, OSArchitecture
            volumes = @($volumes)
            namespace_semantics_qualified = $false
          } | ConvertTo-Json -Depth 4 |
            Set-Content -Encoding utf8 branch-power-loss-results/windows-filesystems.json

      - name: Upload branch power-loss evidence
        if: always()
        uses: actions/upload-artifact@v7
        with:
          name: branch-power-loss-${{ matrix.os }}-${{ matrix.shard }}-${{ github.sha }}
          path: branch-power-loss-results
          if-no-files-found: error

  storage-crash-recovery:
    if: ${{ !inputs.scope || inputs.scope == 'all' }}
    name: Storage Crash Recovery (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        # Linux crash evidence is owned by Prow.
        os: [macos-latest, windows-latest]
    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Install Rust
        uses: dtolnay/rust-toolchain@1.99.1

      - name: Run subprocess crash matrix
        shell: bash
        env:
          HAWDB_TEST_RUST_TOOLCHAIN: "1.99.1"
          HAWDB_TEST_STORAGE_CRASH_EVIDENCE_PATH: storage-crash-results/report.json
        run: |
          set -o pipefail
          mkdir -p storage-crash-results
          set +e
          cargo test -p hawdb --features acl --lib \
            api::tests::storage_recovery::subprocess_crash_matrix_recovers_whole_batches_and_artifact_generations \
            -- --nocapture 2>&1 | tee storage-crash-results/test-output.txt
          test_status=${PIPESTATUS[0]}
          set -e
          printf '{"source_revision":"%s","runner_os":"%s","test_status":%s}\n' \
            "$GITHUB_SHA" "$RUNNER_OS" "$test_status" \
            > storage-crash-results/manifest.json
          exit "$test_status"

      - name: Upload crash recovery evidence
        if: always()
        uses: actions/upload-artifact@v7
        with:
          name: storage-crash-recovery-${{ matrix.os }}-${{ github.sha }}
          path: storage-crash-results
          if-no-files-found: error