Skip to content

Commit 2782458

Browse files
committed
feat: Remove auto encoding mode and associated reproduction scripts, and update CI and documentation for encoding examples.
1 parent feb0d78 commit 2782458

41 files changed

Lines changed: 159 additions & 858 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ jobs:
3737

3838
- name: Verify examples generated
3939
run: |
40-
if [ ! -f "examples/10_dirty_data.zonf" ]; then
40+
if [ ! -f "examples/modes/10_dirty_data_compact.zonf" ]; then
4141
echo "Error: 10_dirty_data.zonf not generated"
4242
exit 1
4343
fi
44-
if [ ! -f "examples/13_deep_recursion.zonf" ]; then
44+
if [ ! -f "examples/modes/13_deep_recursion_compact.zonf" ]; then
4545
echo "Error: 13_deep_recursion.zonf not generated"
4646
exit 1
4747
fi
4848
4949
- name: Verify roundtrip (examples)
50-
run: npx ts-node scripts/verify_roundtrip.ts
50+
run: npx ts-node scripts/verify_roundtrip_modes.ts
5151

5252
- name: Verify roundtrip (comprehensive)
5353
run: node benchmarks/scripts/verify-comprehensive-roundtrip.js

.github/workflows/llm-evals.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Setup Node.js
3838
uses: actions/setup-node@v4
3939
with:
40-
node-version: '18'
40+
node-version: '20'
4141
cache: 'npm'
4242

4343
- name: Install dependencies
@@ -130,7 +130,7 @@ jobs:
130130
- name: Setup Node.js
131131
uses: actions/setup-node@v4
132132
with:
133-
node-version: '18'
133+
node-version: '20'
134134
cache: 'npm'
135135

136136
- name: Install dependencies

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.3.0] - 2025-12-04
9+
10+
### Changed
11+
- **Code Quality**: Refactored entire codebase to remove inline implementation comments, relying on clear code structure and JSDoc.
12+
- **Documentation**: Updated `SPEC.md` and versioning utilities to reflect v1.3.0.
13+
814
## [1.2.0] - 2025-12-03
915

1016
### Major Release: Enterprise Features & Production Readiness

SPEC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Zero Overhead Notation - Formal Specification
44

5-
**Version:** 1.1.0
5+
**Version:** 1.3.0
66

77
**Date:** 2025-12-01
88

compare_deep_toon.ts

Lines changed: 0 additions & 164 deletions
This file was deleted.

compare_toon.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

docs/advanced-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ const data = {
306306

307307
## Performance Tips
308308

309-
1. **Dictionary compression**: Best for repetitive strings (enums, categories)
309+
310310
2. **Dictionary compression**: Best for categorical data (status, roles, countries)
311311
3. **Type coercion**: Enable when dealing with LLM outputs
312312
4. **Field ordering**: Use for retrieval-heavy applications

docs/api-reference.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ F,2,Bob
8787

8888
### `encodeAdaptive(input: any, options?: AdaptiveOptions): string | AdaptiveResult`
8989

90-
Automatically selects the best encoding mode based on data complexity and user preferences.
90+
Encodes data using the specified mode (default: 'compact').
9191

9292
**Options:**
93-
- `mode`: `'auto' | 'compact' | 'readable' | 'llm-optimized'` (default: `'auto'`)
93+
- `mode`: `'compact' | 'readable' | 'llm-optimized'` (default: `'compact'`)
9494
- `indent`: `number` - Indentation spaces for readable mode (default: `2`)
9595
- `debug`: `boolean` - Return detailed analysis (default: `false`)
9696

@@ -100,8 +100,7 @@ F,2,Bob
100100

101101
| Mode | Description | Best For |
102102
|------|-------------|----------|
103-
| `auto` | Analyzes data and picks best mode automatically | General purpose, mixed data |
104-
| `compact` | Maximum compression (tables, T/F, delta encoding) | Production APIs, token efficiency |
103+
| `compact` | Maximum compression (tables, T/F) | Production APIs, token efficiency |
105104
| `readable` | YAML-like syntax with indentation | Config files, human editing |
106105
| `llm-optimized` | Balances clarity and tokens (true/false not T/F) | AI workflows, prompts |
107106

@@ -117,8 +116,7 @@ F,2,Bob
117116
]
118117
};
119118

120-
// Auto mode - let ZON decide
121-
const auto = encodeAdaptive(data, { mode: 'auto' });
119+
122120

123121
// Compact mode - maximum compression
124122
const compact = encodeAdaptive(data, { mode: 'compact' });
@@ -136,7 +134,7 @@ F,2,Bob
136134
**Debug Mode:**
137135

138136
```typescript
139-
const result = encodeAdaptive(data, { mode: 'auto', debug: true });
137+
const result = encodeAdaptive(data, { mode: 'compact', debug: true });
140138
console.log(result.decisions); // See why ZON chose this mode
141139
console.log(result.output); // The encoded string
142140
```

docs/best-practices.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Choose the right encoding mode for your use case to balance token efficiency, re
1111
| Production APIs | `compact` | Maximum token efficiency |
1212
| Config files | `readable` | Human-editable, git-friendly |
1313
| LLM prompts | `llm-optimized` | Best AI understanding |
14-
| Mixed/unknown data | `auto` | Adapts automatically |
14+
1515
| Development/debugging | `readable` | Easiest inspection |
1616
| Caching for LLMs | `compact` or `llm-optimized` | Token efficiency + clarity |
1717

@@ -29,8 +29,7 @@ const configFile = encodeAdaptive(config, { mode: 'readable', indent: 2 });
2929
// For LLM prompts (best comprehension)
3030
const llmPrompt = encodeAdaptive(context, { mode: 'llm-optimized' });
3131

32-
// Let ZON decide
33-
const adaptive = encodeAdaptive(unknownData, { mode: 'auto' });
32+
3433
```
3534

3635
---
@@ -89,7 +88,7 @@ company{departments{engineering{employees[{id:1,name:Alice,role:Senior}]},sales{
8988

9089
1. **Table Format Works**: Uniform data → table encoding → massive token savings
9190
2. **Key Compression**: Repeated keys eliminated via column headers
92-
3. **Delta Encoding**: Sequential IDs compressed efficiently (1, +1, +1)
91+
9392
4. **LLM Friendly**: Tabular data is easier for AI to parse
9493
5. **human Readable**: Even compact mode is clearer with tables
9594

docs/llm-best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Choose the right ZON mode for your LLM workflow:
1919
| **RAG context** | `llm-optimized` | Balances clarity and efficiency |
2020
| **Function calling** | `compact` | Minimal tokens |
2121
| **Human review needed** | `readable` | YAML-like, easy to verify |
22-
| **Mixed/unknown** | `auto` | Adapts automatically |
22+
2323

2424
### Token Impact Examples
2525

0 commit comments

Comments
 (0)