scalable distributed syncing#401
Open
Aditya8369 wants to merge 1 commit into
Open
Conversation
adikulkarni006
approved these changes
Jul 16, 2026
adikulkarni006
left a comment
There was a problem hiding this comment.
"Approved. No major blockers. LGTM."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented a scalable, deterministic “Distributed Schema Compilers & Tooling Sync” subsystem (local, in-memory prototype) with:
New module: src/schema-sync/*
artifact-model.mjs: stable hashing + artifact_id + manifest/artifact constructors
compiler-contract.mjs: compileSchema() -> { manifest, artifact }
sync-protocol.mjs: sync message shapes (announce/push/pull/ack)
permission-enforcer.mjs: redact sensitive sections based on existing src/registry.mjs sensitive-field rules
reconciliation-store.mjs: idempotent applyMessage() + artifact/manifest storage
cap-envelope.mjs: lightweight CAP-like request/packet helpers
index.mjs: exports
Demo script: scripts/schema-sync-demo.mjs
Simulates two nodes, compiles the fitness-challenges schema, pushes to Node A, and applies to Node B with redaction of sensitive metadata.
Tests: test/schema-sync/artifact-sync.test.mjs
Deterministic artifact_id
Idempotent message application
Permission-based redaction behavior
Validation
node --test passes (7 tests).
node scripts/schema-sync-demo.mjs shows Node B storing the artifact with redaction applied.
Note
The referenced docs (docs/distributed-schema-compilers-sync-architecture.md, docs/oauth-flow-schema-compilers-contract.md) and consent source files were not present in the accessible workspace during implementation; the subsystem was built using the existing CAP v1 concepts and current category sensitive-field/permission patterns.
closes #389