Skip to content

Conversation

Copy link

Copilot AI commented Nov 30, 2025

Port of ZON (Zero Overhead Notation) format from zon-ts to Rust. ZON is a compact, human-readable serialization format optimized for LLM token efficiency (23.8% reduction vs JSON).

Core Implementation

  • Encoder (src/encoder.rs): v2.0 format with table encoding, sparse tables, colon-less nested syntax, canonical number formatting
  • Decoder (src/decoder.rs): Strict mode validation (E001/E002), security limits (E301-E304), lazy static regex patterns
  • Schema (src/schema.rs): Runtime validation for LLM guardrails with prompt generation
  • CLI (src/bin/zon.rs): zon encode/decode commands

Test Suite (157 tests)

  • Round-trip codec tests
  • Encoder/decoder conformance
  • Strict mode validation
  • Canonical numbers, security limits

Documentation

  • Full API reference, syntax cheatsheet, LLM best practices guide
  • SPEC.md formal specification
  • Benchmark results copied from zon-ts

Usage

use zon_format::{encode, decode};
use serde_json::json;

let data = json!({
    "users": [
        {"id": 1, "name": "Alice", "active": true},
        {"id": 2, "name": "Bob", "active": false}
    ]
});

let encoded = encode(&data).unwrap();
// users:@(2):active,id,name
// T,1,Alice
// F,2,Bob

let decoded = decode(&encoded).unwrap();
assert_eq!(data, decoded);

MIT licensed with author Roni Bhakta as specified in zon-ts.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com//advisories
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

https://github.com/ZON-Format/zon-ts
Based on this package, I’ve provided you with the logic and motivation of the encoder, decoder, and CLI. Please produce the same tests for the Rust package. Additionally, ensure it’s MIT-licensed with my name, which is mentioned in the provided repo
Make sure that the accuracy is the same as per the Rust language. Also, produce all the documentation as per the guidelines provided. You can copy the benchmark reports from the above package into the Rust package


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 30, 2025
Copilot AI and others added 3 commits November 30, 2025 14:49
Co-authored-by: ronibhakta1 <77425964+ronibhakta1@users.noreply.github.com>
Co-authored-by: ronibhakta1 <77425964+ronibhakta1@users.noreply.github.com>
Co-authored-by: ronibhakta1 <77425964+ronibhakta1@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests and documentation for Rust package Add ZON-RS: Complete Rust implementation with tests and documentation Nov 30, 2025
Copilot AI requested a review from ronibhakta1 November 30, 2025 15:04
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