Skip to content

feat(core): sync source-aware filter parity - #9

Merged
Nanako0129 merged 2 commits into
mainfrom
sync-native-55ca05d3
Jul 28, 2026
Merged

feat(core): sync source-aware filter parity#9
Nanako0129 merged 2 commits into
mainfrom
sync-native-55ca05d3

Conversation

@Nanako0129

Copy link
Copy Markdown
Owner

Summary

  • sync crates/, vendored tokscale-core, the C header, and provider-v3 fixture contract exactly from TokenBar 55ca05d3a0a5bf0f02ed20f46bb3e73e65a07218 (Native PR #111 / issue #107)
  • expose tb_filter_parity_probe through C ABI and C# P/Invoke with source-generation-aware match, mismatch, sourceChanged, and tokenUnavailable results
  • add strict lower-camel C# DTO decoding, bounded smoke output, and reject unknown/numeric enum values
  • pin CI/cross-check provenance to the exact Native source and retain zero Windows shared-tree patches

Semantics

The probe derives the full client list from a fresh graph and brackets hourly/Agents nil-vs-full reports with opaque source tokens. Integer aggregates decide parity; cost remains diagnostic because pricing can refresh independently. A moving source is skipped as sourceChanged rather than misreported as a filter mismatch.

Cargo.lock, cache format/schema, parser versions, and vendored production APIs remain unchanged.

Verification

  • exact archive comparison: crates/, vendor/ (excluding Native-only vendor/AGENTS.md and Windows-only SYNC.md), C header, and provider-v3 fixtures
  • focused Rust parity tests: FFI 10/10; vendor fixture 1/1
  • focused rustfmt for the new Rust files
  • scripts/check.sh
    • workspace check/test/release build with locked dependencies
    • FFI 319 tests; vendor 1,290 tests plus integrations
    • .NET build: 0 warnings / 0 errors
    • Core tests: 287/287
    • P/Invoke smoke with credential/network provider calls disabled
  • fresh verifier found numeric enum acceptance; fixed with allowIntegerValues: false; second fresh verifier confirmed exact strings and fail-closed adjacent cases
  • git diff --check
  • Cargo.lock unchanged

Platform boundary

This PR records macOS-side downstream validation. Hosted Windows x64 and ARM64 cross-package checks remain CI-owned; it does not claim a new real ARM64 runtime run.

Copy the Rust crates, vendored tokscale tree, C header, and provider-v3 fixture contract from TokenBar commit 55ca05d3a0a5bf0f02ed20f46bb3e73e65a07218. Preserve the empty Windows shared-tree patch table, the active cache format and parser identities, and the unchanged consumer-owned Cargo.lock.

Expose tb_filter_parity_probe as the eleventh C ABI entry point. The probe derives the full client slice from a fresh graph, brackets hourly and Agents nil/full reports with token0 through token5 source generations, short-circuits unstable scans as sourceChanged or tokenUnavailable, compares integer aggregates exactly, and keeps independently refreshed cost diagnostic-only.

Add the C# P/Invoke facade, strict lower-camel status decoder, nullable aggregate DTOs, invariant bounded smoke summary, and smoke entry. Numeric and unknown enum values now fail closed at the shared TbCore JSON boundary while every returned heap pointer continues through Unwrap and the existing finally tb_free ownership path.

Pin CI, cross-check documentation, and the Windows sync ledger to the merged Native source. Record exact-tree exclusions and local validation without claiming hosted or real ARM64 runtime evidence for this sync.

Verification: exact crates/vendor/header/fixture comparisons; focused Rust parity tests; focused rustfmt; scripts/check.sh with locked workspace check/test/release build, 319 FFI tests, 1,290 vendor unit tests plus integrations, 287 Core tests, and cache-only network-skipped P/Invoke smoke; final dotnet build and 287 tests after the strict-enum review fix; git diff --check; two fresh verifier passes, ending CONFIRMED.
Pass -AppleLanguages "(en)" to both the legacy and provider-v3 cross-check harness invocations so the Native 55ca05d fail-closed localization guard can generate canonical outputs. Keep the documented operator commands identical to the hosted CI contract.\n\nVerified both harness paths after rebuilding the locked Rust release archive: the legacy run produced 42 usage-pace and 74 format cases, while provider-v3 produced 12 cases. git diff --cached --check also passed.
@Nanako0129
Nanako0129 merged commit a37a557 into main Jul 28, 2026
3 checks passed
@Nanako0129
Nanako0129 deleted the sync-native-55ca05d3 branch July 28, 2026 06:36
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.

1 participant