Skip to content

feat(hotpath): fill global-db schema/session/transcript gaps - #780

Merged
ScriptedAlchemy merged 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-global-db-gaps-5f1c
Sep 3, 2026
Merged

feat(hotpath): fill global-db schema/session/transcript gaps#780
ScriptedAlchemy merged 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-global-db-gaps-5f1c

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Fills the remaining hotpath coverage gaps in crates/tracedecay-global-db (HP-global) only. Adds #[hotpath::measure(future = true, label = ...)] spans to previously unmeasured async production functions; no other crate is touched and Cargo.toml features are unchanged (already wired). All macros are no-ops without --features hotpath; the feature stays out of default/production. Getters, Display impls, tests, _for_test/_with_engine (cfg(test)) helpers, and trivial one-line delegators are skipped. In the observation-projection mixed file, only the two production persist_projection_*_on_database helpers were missing spans (project_observation was already measured), so only those were added.

Files and new labels

File New labels (global_db. prefix)
schema_contract/validation.rs schema_contract.validate.table, schema_contract.validate.indexes, schema_contract.validate.trigger, schema_contract.validate.autoincrement, schema_contract.validate.session_temporal, schema_contract.validate.projection_receipts, schema_contract.validate.graph_publication, schema_contract.query.graph_inventory, schema_contract.validate.registry, schema_contract.validate.remote_deletion, schema_contract.validate.authority
schema_contract/invariants/rows.rs schema_contract.audit.probe, schema_contract.audit.receipt_rows, schema_contract.audit.observation_rows, schema_contract.audit.source_cursor_rows, schema_contract.audit.source_cursor_chunk, schema_contract.audit.mutable_rows
schema_contract/invariants/triggers.rs schema_contract.triggers.replace, schema_contract.triggers.contracts_intact, schema_contract.triggers.released_v3_intact, schema_contract.triggers.match_sql, schema_contract.triggers.suspend_immutability, schema_contract.triggers.restore_immutability
schema_contract/invariants/repair.rs schema_contract.repair.read_frontier, schema_contract.repair.projection_frontier, schema_contract.repair.source_cursors, schema_contract.repair.scan_committed, schema_contract.repair.read_cursor, schema_contract.repair.write_cursor, schema_contract.repair.check_advance_receipt, schema_contract.repair.cursor_coverage
registered_sessions.rs sessions.ingest_health, sessions.ingest_health_provider, sessions.has_message, sessions.message_count, sessions.project_message_count, sessions.messages_after, sessions.latest_activity, sessions.get_message, sessions.search_messages, sessions.recent_goals, sessions.workflow_facts
session_temporal_handle.rs session_temporal.doctor_health, session_temporal.ensure_cursor_key, session_temporal.load_cursor_key_provider, session_temporal.load_preprovisioned_cursor_key, session_temporal.pending_refresh_page, session_temporal.materialize_refresh_batch, session_temporal.freeze_snapshot, session_temporal.summary_relations, session_temporal.apply_relation_projection, session_temporal.recover_relation_projections, session_temporal.refresh_recovery, session_temporal.complete_refresh
transcript.rs transcript.upsert_session, transcript.get_session, transcript.get_session_result, transcript.upsert_batch, transcript.persist_batch, transcript.persist_offset, transcript.upsert_projection_batches, transcript.get_parse_offset, transcript.get_parse_offset_result, transcript.set_parse_offset, transcript.advance_parse_offset, transcript.replace_parse_offset, transcript.replace_parse_offset_pair
registered/delivery_settlement.rs delivery_settlement.query.censuses, delivery_settlement.persist.begin, delivery_settlement.persist.begin_receipted, delivery_settlement.query.source_receipt, delivery_settlement.query.pending_due, delivery_settlement.persist.settle, delivery_settlement.persist.bind_receipt, delivery_settlement.persist.fanout_identity, delivery_settlement.query.read_attempt, delivery_settlement.query.count_attempts, delivery_settlement.query.pending_census
configuration/store/mutation.rs configuration.query.idempotency_receipt, configuration.persist.mutation_receipt, configuration.query.replay_match, configuration.persist.commit, configuration.persist.commit_with_registry, configuration.persist.build_commit, configuration.query.current_state, configuration.query.replay_control, configuration.persist.commit_direct, configuration.persist.commit_direct_registry
configuration/store/audit.rs configuration.audit.read_key, configuration.audit.ensure_key, configuration.audit.seal_target, configuration.audit.validate_seal, configuration.audit.insert_dry_run, configuration.audit.read_event, configuration.audit.insert_event, configuration.audit.append_terminal, configuration.audit.match_terminal, configuration.audit.read_page
observation_projection/rebuild.rs observation_projection.persist.retry, observation_projection.persist.rejection

Verification

  • cargo check -p tracedecay-global-db — passes (macros no-op, identical compile).
  • cargo check -p tracedecay-global-db --features hotpath — passes.
  • cargo clippy -p tracedecay-global-db --features hotpath --all-targets — clean.
  • npm run lint:commit passes for the new commit (pre-existing merge: subjects on the base branch fail independently of this change).
Open in Web Open in Cursor 

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0889d12

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedcursor/hotpath-global-db-gaps-5f1c

Total Elapsed Time: 5.42s → 5.18s (-4.5%)
CPU Baseline: 89.91µs → 91.74µs (+2.0%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                              | P95                              | Total                            | % Total                      |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 5.42s → 5.18s (-4.4%)            | 5.42s → 5.18s (-4.4%)            | 5.42s → 5.18s (-4.4%)            | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 180.77ms → 188.28ms (+4.2%)      | 239.73ms → 264.37ms (+10.3%)     | 2.35s → 2.45s (+4.3%)            | 43.37% → 47.28% (+9.0%)      |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 124.62ms → 121.23ms (-2.7%)      | 164.50ms → 164.23ms (-0.2%)      | 1.62s → 1.58s (-2.5%)            | 29.90% → 30.45% (+1.8%)      |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 105.77ms → 106.04ms (+0.3%)      | 143.79ms → 144.57ms (+0.5%)      | 1.37s → 1.38s (+0.7%)            | 25.38% → 26.63% (+4.9%)      |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 19.02ms → 16.59ms (-12.8%)       | 51.84ms → 69.27ms (+33.6%) ⚠️    | 1.58s → 1.38s (-12.7%)           | 29.13% → 26.60% (-8.7%)      |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file | 276 → 276 (+0.0%)          | 6.38ms → 4.50ms (-29.5%) 🚀      | 11.90ms → 6.68ms (-43.9%) 🚀     | 1.76s → 1.24s (-29.5%) 🚀        | 32.48% → 24.00% (-26.1%) 🚀  |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 630.87ms → 501.70ms (-20.5%) 🚀  | 668.47ms → 502.01ms (-24.9%) 🚀  | 1.26s → 1.00s (-20.6%) 🚀        | 23.29% → 19.38% (-16.8%)     |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| domain.canonical.sha256                  | 114526 → 114526 (+0.0%)    | 11.06µs → 8.52µs (-23.0%) 🚀     | 14.09µs → 14.01µs (-0.6%)        | 1.27s → 976.08ms (-23.1%) 🚀     | 23.39% → 18.86% (-19.4%)     |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 52.76ms → 54.39ms (+3.1%)        | 263.72ms → 265.16ms (+0.5%)      | 738.63ms → 761.45ms (+3.1%)      | 13.63% → 14.71% (+7.9%)      |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 46.73ms → 57.23ms (+22.5%) ⚠️    | 66.81ms → 87.43ms (+30.9%) ⚠️    | 607.44ms → 743.93ms (+22.5%) ⚠️  | 11.21% → 14.37% (+28.2%) ⚠️  |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| 🆕 query.artifact.batch.parallel_prepare | 0 → 13 (+100.0%) ⚠️        | 0.00ns → 46.02ms (+100.0%) ⚠️    | 0.00ns → 72.22ms (+100.0%) ⚠️    | 0.00ns → 598.24ms (+100.0%) ⚠️   | 0.00% → 11.56% (+100.0%) ⚠️  |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 2.99ms → 2.06ms (-31.1%) 🚀      | 6.00ms → 3.00ms (-50.0%) 🚀      | 825.33ms → 569.50ms (-31.0%) 🚀  | 15.23% → 11.00% (-27.8%) 🚀  |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 2.64ms → 1.93ms (-26.9%) 🚀      | 5.60ms → 2.95ms (-47.3%) 🚀      | 728.54ms → 532.32ms (-26.9%) 🚀  | 13.45% → 10.28% (-23.6%) 🚀  |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| 🆕 code_index.build.assemble             | 0 → 2 (+100.0%) ⚠️         | 0.00ns → 186.68ms (+100.0%) ⚠️   | 0.00ns → 199.23ms (+100.0%) ⚠️   | 0.00ns → 373.36ms (+100.0%) ⚠️   | 0.00% → 7.21% (+100.0%) ⚠️   |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.chunk.build                   | 276 → 276 (+0.0%)          | 1.80ms → 1.26ms (-30.0%) 🚀      | 4.37ms → 1.81ms (-58.6%) 🚀      | 495.64ms → 346.56ms (-30.1%) 🚀  | 9.15% → 6.69% (-26.9%) 🚀    |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| 🗑️ code_index.chunk.map_ordered          | 780 → 0 (-100.0%) 🚀       | 642.66µs → 0.00ns (-100.0%) 🚀   | 1.47ms → 0.00ns (-100.0%) 🚀     | 501.28ms → 0.00ns (-100.0%) 🚀   | 9.25% → 0.00% (-100.0%) 🚀   |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+
| 🗑️ code_index.chunk.identify             | 276 → 0 (-100.0%) 🚀       | 1.78ms → 0.00ns (-100.0%) 🚀     | 4.35ms → 0.00ns (-100.0%) 🚀     | 491.00ms → 0.00ns (-100.0%) 🚀   | 9.06% → 0.00% (-100.0%) 🚀   |
+------------------------------------------+----------------------------+----------------------------------+----------------------------------+----------------------------------+------------------------------+

Generated with hotpath-rs

@ScriptedAlchemy
ScriptedAlchemy merged commit 15b3b0f into codex/tracedecay-total-redesign-plan-reopened Sep 3, 2026
10 of 18 checks passed
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Integrated into codex/tracedecay-total-redesign-plan-reopened.

  • Merge commit: 15b3b0f2f24dcb27584d17d693e97e78f8600ccd
  • Published target head after merging the latest target: 2d42ee1f041a490a3d9fa7b0a5a845519b0b9113
  • cargo test -p tracedecay-global-db --locked -- --test-threads=1 — passed (339 unit, 1 fail-closed integration, 8 session graph tests)
  • cargo check -p tracedecay-global-db --features hotpath --locked — passed
  • cargo check -p tracedecay --no-default-features --locked — passed
  • git diff --check — passed

The original commit was verified as 100 hotpath::measure attributes (232 added lines), with no deletions or semantic edits. The PR had no review threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants