Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
50a1f2a
feat(testing,schema): block direct cargo test and add schema sync sum…
Sinity Nov 8, 2025
d3c1e52
chore(testing): stop blocking direct cargo test invocations
Sinity Nov 8, 2025
82dc7e2
feat(tooling): add non-interactive batch bundler that emits source/te…
Sinity Nov 8, 2025
5bae0cb
feat(replay): add replay control RPCs and cascade execution helpers
Sinity Nov 8, 2025
4ca9c89
refactor(automata): align analytics and search with runtime
Sinity Nov 8, 2025
81b8837
feat(payloads): generate builder helpers in the EventPayload derive
Sinity Nov 8, 2025
6b7d347
feat(query): add shared pagination types and repository-backed event …
Sinity Nov 8, 2025
c553865
docs(db): record the remaining ad-hoc SQL migration plan
Sinity Nov 8, 2025
939ead8
refactor(core): adopt Pagination and replace SeaQuery time-series que…
Sinity Nov 8, 2025
bdc4bd3
refactor(core,test-utils): add shared fixture constants and tidy quer…
Sinity Nov 9, 2025
72d4681
test(core): reuse shared fixture constants across integration suites
Sinity Nov 9, 2025
c94b442
feat(core,gateway): add range-aware replays and finish the cascade re…
Sinity Nov 9, 2025
b45ff79
refactor(core,gateway): move cascade helpers into EventRepository
Sinity Nov 9, 2025
d1c4989
docs(todo): add explicit fail-first remediation backlog for repositor…
Sinity Nov 9, 2025
0397861
refactor(core): remove leftover SeaQuery helper code
Sinity Nov 9, 2025
42bba85
build(core): limit SeaQuery to the schema crate
Sinity Nov 9, 2025
526f5f8
refactor(env): migrate the development workflow to devenv
Sinity Nov 12, 2025
f9c83e3
ci(workflows): pin CI images and fail on stale schemas
Sinity Nov 12, 2025
74aa31c
refactor(sdk,schema,ingestors): remove sensd and legacy job-managemen…
Sinity Nov 12, 2025
6f56a0c
feat(schema): regenerate v1 payload contracts, add registry manifest,…
Sinity Nov 12, 2025
b2ffbfc
test(gateway,sdk): add fail-first replay and blob regressions
Sinity Nov 12, 2025
f2c04af
docs(architecture): rewrite progress docs around schema CLI and replay
Sinity Nov 12, 2025
0fcd162
ci(docs): document schema source-of-truth and enforce regeneration
Sinity Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ incremental = true
pipelining = true
# Use all available CPU cores for compilation
jobs = 24
rustc-workspace-wrapper = "scripts/rustc_wrapper.sh"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description notes that the rustc wrapper-based enforcement was backed out, but the workspace config re-introduces a rustc-workspace-wrapper. If this wrapper is only meant for CI enforcement, gate it behind an env var/profile-specific config (or remove it from repo-wide config) to avoid surprising local builds and platform-specific failures when the script is missing/non-executable.

Copilot uses AI. Check for mistakes.

# Shared build cache across the workspace (experimental)
[unstable]
Expand Down Expand Up @@ -53,8 +54,8 @@ cf = [
"--features",
] # Check with features

[env]
# Environment variables for coverage and testing
[env]
CARGO_LLVM_COV_TARGET_DIR = { value = "target/llvm-cov", relative = true }

# Speed optimizations via environment variables
Expand Down
7 changes: 6 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ retries = 1
# Simple timeout - if a test takes more than 2 minutes, something is wrong
slow-timeout = { period = "120s", terminate-after = 1 }


# Better failure reporting
[profile.default.junit]
path = "target/nextest/junit.xml"
Expand All @@ -30,6 +31,7 @@ success-output = "never"
retries = 0
slow-timeout = { period = "60s", terminate-after = 1 }


# Reliable profile for CI - more retries, limited parallelism
[profile.reliable]
test-threads = 2
Expand All @@ -38,6 +40,7 @@ success-output = "never"
retries = 3
slow-timeout = { period = "180s", terminate-after = 1 }


# Debug profile - show all output
[profile.debug]
test-threads = 1
Expand All @@ -46,6 +49,7 @@ success-output = "immediate-final"
retries = 0
slow-timeout = { period = "300s", terminate-after = 1 }


# Parallel profile - maximum parallelism for speed
[profile.parallel]
# Use all available CPUs for maximum speed
Expand All @@ -58,6 +62,7 @@ retries = 0
# Shorter timeout for parallel execution
slow-timeout = { period = "60s", terminate-after = 1 }


# CI parallel profile - balanced for reliability with good parallelism
[profile.ci-parallel]
# Use 75% of CPUs to leave headroom for system
Expand All @@ -66,4 +71,4 @@ failure-output = "immediate-final"
success-output = "never"
# One retry for flaky tests
retries = 1
slow-timeout = { period = "120s", terminate-after = 1 }
slow-timeout = { period = "120s", terminate-after = 1 }
43 changes: 0 additions & 43 deletions .github/workflows/abstractions.yml

This file was deleted.

44 changes: 38 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

services:
postgres:
image: timescale/timescaledb-ha:pg16-latest
image: timescale/timescaledb:2.15.2-pg16 # Pin exact Timescale/Postgres versions for deterministic CI
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -54,6 +54,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Enforce forbidden pattern guards
run: bash scripts/check_forbidden_patterns.sh

- name: Regenerate schemas and ensure repository is clean
# Treat schemas/ like a generated artifact (similar to cargo fmt).
env:
DATABASE_URL: postgres://sinex_test:test_password@localhost/sinex_test
run: |
./scripts/schema-dev.sh generate
if ! git diff --quiet -- schemas; then
echo "::error::Schema artifacts are stale. Run './scripts/schema-dev.sh generate' and commit the results."
git status schemas
exit 1
fi

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -90,21 +105,22 @@ jobs:
env:
DATABASE_URL: postgres://sinex_test:test_password@localhost/sinex_test
run: |
cd crate/sinex-db/migration && cargo run -- up
cd crate/lib/sinex-schema
cargo run -- up

- name: Run tests
env:
DATABASE_URL: postgres://sinex_test:test_password@localhost/sinex_test
RUST_LOG: debug
run: cargo test --all-features
run: cargo nextest run --all-features --workspace

coverage:
name: Code Coverage
runs-on: ubuntu-latest

services:
postgres:
image: timescale/timescaledb-ha:pg16-latest
image: timescale/timescaledb:2.15.2-pg16 # Pin exact Timescale/Postgres versions for deterministic CI
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -120,6 +136,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Enforce forbidden pattern guards
run: bash scripts/check_forbidden_patterns.sh

- name: Regenerate schemas and ensure repository is clean
# Treat schemas/ like a generated artifact (similar to cargo fmt).
env:
DATABASE_URL: postgres://sinex_test:test_password@localhost/sinex_test
run: |
./scripts/schema-dev.sh generate
if ! git diff --quiet -- schemas; then
echo "::error::Schema artifacts are stale. Run './scripts/schema-dev.sh generate' and commit the results."
git status schemas
exit 1
fi

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -149,7 +180,8 @@ jobs:
env:
DATABASE_URL: postgres://sinex_test:test_password@localhost/sinex_test
run: |
cd crate/sinex-db/migration && cargo run -- up
cd crate/lib/sinex-schema
cargo run -- up

- name: Generate code coverage
env:
Expand All @@ -160,4 +192,4 @@ jobs:
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: false
fail_ci_if_error: false
22 changes: 6 additions & 16 deletions .github/workflows/schema-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Schema Compatibility Check
on:
pull_request:
paths:
- 'crate/sinex-events/src/payloads/**'
- 'crate/sinex-events/src/event.rs'
- 'crate/sinex-macros/src/event_payload.rs'
- 'schemas/**'
- 'crate/lib/sinex-core/src/types/events/**'
- 'scripts/check-schema-compatibility.sh'

jobs:
check-schemas:
Expand All @@ -29,15 +29,6 @@ jobs:
chmod +x scripts/check-schema-compatibility.sh
CI_BASE_BRANCH=${{ github.base_ref }} ./scripts/check-schema-compatibility.sh

- name: Generate schema report
if: always()
run: |
echo "## Schema Compatibility Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f schema-report.md ]; then
cat schema-report.md >> $GITHUB_STEP_SUMMARY
fi

- name: Comment on PR
if: failure()
uses: actions/github-script@v7
Expand All @@ -47,9 +38,8 @@ jobs:
❌ **Schema Compatibility Check Failed**

Please ensure:
- Version numbers are incremented for breaking changes
- \`evolves_from\` is specified for major version changes
- Breaking changes are documented with \`breaking_change\` attribute
- Any breaking changes get a schema version bump
- Optional additions remain backward compatible

Run \`./scripts/check-schema-compatibility.sh\` locally for details.
`;
Expand All @@ -59,4 +49,4 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
body: message
});
});
60 changes: 10 additions & 50 deletions .github/workflows/schema-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ on:
push:
branches: [ master, 'claude/**' ]
paths:
- 'crate/sinex-events/src/**/*.rs'
- 'crate/lib/sinex-core/src/types/events/**/*.rs'
- 'schemas/**/*.json'
- 'scripts/schema-dev.sh'
- '.github/workflows/schema-management.yml'
pull_request:
branches: [ master ]
paths:
- 'crate/sinex-events/src/**/*.rs'
- 'crate/lib/sinex-core/src/types/events/**/*.rs'
- 'schemas/**/*.json'
- 'scripts/schema-dev.sh'
- '.github/workflows/schema-management.yml'

jobs:
Expand Down Expand Up @@ -59,9 +61,9 @@ jobs:
name: sinex
skipPush: true

- name: Generate schemas
- name: Generate schemas via CLI
run: |
nix develop --command cargo run --package sinex-events --bin generate-schemas
nix develop --command ./scripts/schema-dev.sh generate

- name: Check for schema changes
id: check-changes
Expand All @@ -84,53 +86,11 @@ jobs:
git commit -m "chore: update generated schemas [skip ci]"
git push

check-compatibility:
name: Check Schema Compatibility
runs-on: ubuntu-latest
needs: generate-schemas
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install json-schema-diff
run: npm install -g json-schema-diff

- name: Check backward compatibility
run: |
echo "Checking schema backward compatibility..."
BASE_BRANCH="${{ github.base_ref }}"

# Get list of schema files that exist in both branches
git ls-tree -r origin/$BASE_BRANCH --name-only | grep "^schemas/.*\.json$" | while read schema_path; do
if [ -f "$schema_path" ]; then
echo "Checking compatibility for: $schema_path"

# Get schema from base branch
git show origin/$BASE_BRANCH:$schema_path > /tmp/base_schema.json

# Compare schemas
if ! json-schema-diff /tmp/base_schema.json $schema_path; then
echo "⚠️ Breaking change detected in $schema_path"
echo "Consider incrementing the schema version if this is intentional"
exit 1
fi
fi
done

echo "✅ All schema changes are backward compatible"

deploy-schemas:
name: Deploy Schemas to Database
runs-on: ubuntu-latest
needs: [validate-schemas, generate-schemas]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && secrets.SINEX_PROD_DATABASE_URL != ''
steps:
- uses: actions/checkout@v4

Expand All @@ -142,7 +102,7 @@ jobs:
experimental-features = nix-command flakes

- name: Deploy schemas
env:
DATABASE_URL: ${{ secrets.SINEX_PROD_DATABASE_URL }}
run: |
echo "🚀 Deploying schemas to production database..."
echo "Note: This step requires the deployment script to be implemented"
# nix develop --command ./scripts/deploy-schemas.sh
nix develop --command ./scripts/deploy-schemas.sh
Loading
Loading