ace-b36ts 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ace-defaults/b36ts/config.yml +13 -0
- data/.ace-defaults/nav/protocols/skill-sources/ace-b36ts.yml +19 -0
- data/.ace-defaults/nav/protocols/wfi-sources/ace-b36ts.yml +19 -0
- data/CHANGELOG.md +283 -0
- data/LICENSE +21 -0
- data/README.md +54 -0
- data/Rakefile +17 -0
- data/exe/ace-b36ts +14 -0
- data/handbook/agents/b36ts.ag.md +93 -0
- data/handbook/skills/as-b36ts/SKILL.md +20 -0
- data/handbook/workflow-instructions/b36ts.wf.md +127 -0
- data/lib/ace/b36ts/atoms/compact_id_encoder.rb +656 -0
- data/lib/ace/b36ts/atoms/format_codecs.rb +661 -0
- data/lib/ace/b36ts/atoms/format_specs.rb +178 -0
- data/lib/ace/b36ts/atoms/formats.rb +110 -0
- data/lib/ace/b36ts/cli/commands/config.rb +29 -0
- data/lib/ace/b36ts/cli/commands/decode.rb +47 -0
- data/lib/ace/b36ts/cli/commands/encode.rb +52 -0
- data/lib/ace/b36ts/cli.rb +71 -0
- data/lib/ace/b36ts/commands/config_command.rb +52 -0
- data/lib/ace/b36ts/commands/decode_command.rb +104 -0
- data/lib/ace/b36ts/commands/encode_command.rb +179 -0
- data/lib/ace/b36ts/molecules/config_resolver.rb +166 -0
- data/lib/ace/b36ts/version.rb +11 -0
- data/lib/ace/b36ts.rb +203 -0
- metadata +157 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 0f46ea122b159e8bffa0f0f6ace4475c464d6b9fc2114f0c6aa919d3508b8ced
|
|
4
|
+
data.tar.gz: 2c560c36b2e271e2dd55c05f634225b260ffca39c5b4a7670d8a775d8f6a57cf
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: f69f1c85a2e3946e94c9251ebaa0ab948746e2381d8caf0a7a9482c2be904bf9841a200da8cc78ab43adc24f22cbd6ebdc4adaa3c1a248d32073499b18628419
|
|
7
|
+
data.tar.gz: 5fc5dd548defdba8d406b5453d4cfbd2c4f09c5499d7e57621528f005c875c76aeeda350bc88d27ff1afd70c8d184f8837223b448c4503a6640b49c5803ce0b4
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# ace-b36ts configuration
|
|
2
|
+
# Place in .ace/b36ts/config.yml to override defaults
|
|
3
|
+
|
|
4
|
+
b36ts:
|
|
5
|
+
# Base year for compact ID encoding (year 0 = 108-year coverage)
|
|
6
|
+
year_zero: 2000
|
|
7
|
+
|
|
8
|
+
# Base36 alphabet for encoding (0-9, a-z)
|
|
9
|
+
alphabet: "0123456789abcdefghijklmnopqrstuvwxyz"
|
|
10
|
+
|
|
11
|
+
# Default output format for encode command
|
|
12
|
+
# Options: 2sec (default), month, week, day, 40min, 50ms, ms
|
|
13
|
+
default_format: "2sec"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Skill Sources Protocol Configuration for ace-b36ts
|
|
3
|
+
# This enables canonical skill discovery from the ace-b36ts gem
|
|
4
|
+
|
|
5
|
+
name: ace-b36ts
|
|
6
|
+
type: gem
|
|
7
|
+
description: Canonical skills from ace-b36ts gem
|
|
8
|
+
priority: 10
|
|
9
|
+
|
|
10
|
+
# Configuration for skill discovery within the gem
|
|
11
|
+
config:
|
|
12
|
+
# Relative path within the gem
|
|
13
|
+
relative_path: handbook/skills
|
|
14
|
+
|
|
15
|
+
# Pattern for finding canonical skill files
|
|
16
|
+
pattern: "*/SKILL.md"
|
|
17
|
+
|
|
18
|
+
# Enable discovery
|
|
19
|
+
enabled: true
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
# WFI Sources Protocol Configuration for ace-b36ts
|
|
3
|
+
# This enables workflow discovery from the ace-b36ts gem
|
|
4
|
+
|
|
5
|
+
name: ace-b36ts
|
|
6
|
+
type: gem
|
|
7
|
+
description: Timestamp workflow instructions from ace-b36ts gem
|
|
8
|
+
priority: 10
|
|
9
|
+
|
|
10
|
+
# Configuration for workflow discovery within the gem
|
|
11
|
+
config:
|
|
12
|
+
# Relative path within the gem (default: handbook/workflow-instructions)
|
|
13
|
+
relative_path: handbook/workflow-instructions
|
|
14
|
+
|
|
15
|
+
# Pattern for finding workflow files (default: *.wf.md)
|
|
16
|
+
pattern: "*.wf.md"
|
|
17
|
+
|
|
18
|
+
# Enable discovery
|
|
19
|
+
enabled: true
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to ace-b36ts (formerly ace-support-timestamp) will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.13.0] - 2026-03-23
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Added format examples table to README showing all 7 encode formats with real IDs, character lengths, and precision.
|
|
14
|
+
- Fixed misleading "6-character" claim in How It Works -- formats range from 2 to 8 characters.
|
|
15
|
+
- Added day/week disambiguation note explaining 3rd-character value ranges.
|
|
16
|
+
- Expanded demo tape with multiple-ID generation (`-n 3`) and split path (`--split month,week --path-only`) scenarios.
|
|
17
|
+
- Re-recorded getting-started GIF with the expanded demo flow.
|
|
18
|
+
|
|
19
|
+
## [0.12.2] - 2026-03-23
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Refreshed the package README to match the current layout pattern with quick-link navigation, use-case framing, and normalized section flow.
|
|
23
|
+
|
|
24
|
+
## [0.12.1] - 2026-03-22
|
|
25
|
+
|
|
26
|
+
### Technical
|
|
27
|
+
- Restored the `VERSION` constant indentation in `lib/ace/b36ts/version.rb` to match the package Ruby style.
|
|
28
|
+
|
|
29
|
+
## [0.12.0] - 2026-03-22
|
|
30
|
+
|
|
31
|
+
### Technical
|
|
32
|
+
- Replaced the package README with a landing-page layout for faster onboarding.
|
|
33
|
+
- Added tutorial-style getting-started docs, full CLI usage reference, and handbook catalog docs.
|
|
34
|
+
- Added and shipped demo GIF assets for a round-trip `encode` → `decode` walkthrough.
|
|
35
|
+
|
|
36
|
+
## [0.11.3] - 2026-03-18
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- Tightened `TS-B36TS-001-pilot` E2E runner and verifier contracts for Goals 5-8 with deterministic inputs, explicit artifact naming, and stronger evidence checks.
|
|
40
|
+
|
|
41
|
+
## [0.11.2] - 2026-03-18
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
- Treated naïve timestamp strings as UTC while preserving explicit timezone parsing in `ace-b36ts encode`.
|
|
45
|
+
|
|
46
|
+
## [0.11.1] - 2026-03-18
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
- Migrated CLI namespace from `Ace::Core::CLI::*` to `Ace::Support::Cli::*` (ace-support-cli is now the canonical home for CLI infrastructure).
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## [0.11.0] - 2026-03-18
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
- Removed legacy backward-compatibility behavior as part of the 0.10 cleanup release.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## [0.10.3] - 2026-03-15
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
- Migrated CLI framework from dry-cli to ace-support-cli
|
|
62
|
+
|
|
63
|
+
## [0.10.2] - 2026-03-13
|
|
64
|
+
|
|
65
|
+
### Changed
|
|
66
|
+
- Updated the canonical `as-b36ts` skill to explicitly run its bundled workflow in the current project and execute it end-to-end.
|
|
67
|
+
|
|
68
|
+
## [0.10.1] - 2026-03-13
|
|
69
|
+
|
|
70
|
+
### Changed
|
|
71
|
+
- Removed the Codex-specific delegated execution metadata from the canonical `as-b36ts` skill so provider projections now inherit the canonical skill body unchanged.
|
|
72
|
+
|
|
73
|
+
## [0.10.0] - 2026-03-12
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
- Added Codex-specific delegated execution metadata to the canonical `as-b36ts` skill so the generated Codex skill runs in fork context on `gpt-5.3-codex-spark`.
|
|
77
|
+
|
|
78
|
+
## [0.9.1] - 2026-03-10
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
- Added the missing canonical `# bundle:` metadata to the `as-b36ts` skill so it validates under the strict typed skill schema.
|
|
82
|
+
|
|
83
|
+
## [0.9.0] - 2026-03-09
|
|
84
|
+
|
|
85
|
+
### Added
|
|
86
|
+
- Added `skill-sources` gem defaults registration at `.ace-defaults/nav/protocols/skill-sources/ace-b36ts.yml` so `skill://` can discover canonical `handbook/skills` entries from `ace-b36ts`.
|
|
87
|
+
|
|
88
|
+
## [0.8.0] - 2026-03-09
|
|
89
|
+
|
|
90
|
+
### Added
|
|
91
|
+
- Added canonical capability skill example at `handbook/skills/as-b36ts/SKILL.md` with workflow binding to `wfi://b36ts`.
|
|
92
|
+
|
|
93
|
+
## [0.7.5] - 2026-02-28
|
|
94
|
+
|
|
95
|
+
### Fixed
|
|
96
|
+
- `encode_split` week token now uses ISO Thursday-based attribution (`iso_week_month_and_number`) instead of naive day-based calculation (`simple_week_in_month`)
|
|
97
|
+
- `encode_split` week token now correctly encodes values 31-35 (base36 `v`–`z`) instead of raw week numbers 1-5, matching `encode_week` output
|
|
98
|
+
- `encode_split` month component now uses the ISO week's month when `:week` is in levels, ensuring boundary dates (e.g., Sunday Mar 1 whose Thursday is Feb 26) partition to the correct month
|
|
99
|
+
|
|
100
|
+
## [0.7.4] - 2026-02-24
|
|
101
|
+
|
|
102
|
+
### Changed
|
|
103
|
+
- Migrated `ace-b36ts/test/e2e` to goal-mode pilot scenario `TS-B36TS-001-pilot`
|
|
104
|
+
- Replaced four legacy procedural E2E scenarios with runner/verifier split test assets
|
|
105
|
+
- Updated pilot `scenario.yml` with required loader fields (`area`, `setup`) for `ace-test-e2e` compatibility
|
|
106
|
+
|
|
107
|
+
## [0.7.3] - 2026-02-23
|
|
108
|
+
|
|
109
|
+
### Changed
|
|
110
|
+
- Extracted format-specific encode/decode/increment methods into FormatCodecs module
|
|
111
|
+
- Reduced CompactIdEncoder from 1,294 to 654 lines
|
|
112
|
+
|
|
113
|
+
### Technical
|
|
114
|
+
- Updated internal dependency version constraints to current releases
|
|
115
|
+
|
|
116
|
+
## [0.7.2] - 2026-02-22
|
|
117
|
+
|
|
118
|
+
### Changed
|
|
119
|
+
- Migrated to standard dry-cli help pattern (no args shows help)
|
|
120
|
+
- Removed DefaultRouting extension in favor of HelpCommand registration
|
|
121
|
+
|
|
122
|
+
## [0.7.1] - 2026-02-22
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
- Standardized quiet, verbose, debug option descriptions to canonical strings
|
|
126
|
+
|
|
127
|
+
## [0.7.0] - 2026-02-17
|
|
128
|
+
|
|
129
|
+
### Changed
|
|
130
|
+
- Week format (`encode_week`/`decode_week`) now uses ISO Thursday rule instead of simple day-based calculation
|
|
131
|
+
- A week belongs to the month containing its Thursday (ISO 8601 convention)
|
|
132
|
+
- Boundary dates (e.g., Feb 1 on a Saturday) encode as the previous month's week
|
|
133
|
+
- Year-crossing dates (e.g., Dec 31 on a Wednesday) encode as the next year's January
|
|
134
|
+
- `decode_week` now returns the Thursday of the week (the defining day)
|
|
135
|
+
- Week values remain 1-5 (encoded as 31-35); format is unchanged
|
|
136
|
+
- Split encoder (`encode_split`) retains simple day-based week calculation for path buckets
|
|
137
|
+
|
|
138
|
+
### Technical
|
|
139
|
+
- Added `iso_week_month_and_number` private helper for ISO Thursday-based week-in-month calculation
|
|
140
|
+
- Renamed `calculate_week_in_month` to `simple_week_in_month` (used by split encoder only)
|
|
141
|
+
- Added `calculate_months_offset_ym` helper for explicit year/month offset calculation
|
|
142
|
+
- Expanded week format test coverage with ISO boundary, year-crossing, and leap year cases
|
|
143
|
+
|
|
144
|
+
## [0.6.0] - 2026-02-14
|
|
145
|
+
|
|
146
|
+
### Changed
|
|
147
|
+
- **Breaking**: Gem renamed from `ace-support-timestamp` to `ace-b36ts` (task 267)
|
|
148
|
+
- Namespace changed from `Ace::Support::Timestamp` to `Ace::B36ts`
|
|
149
|
+
- Binary changed from `ace-timestamp` to `ace-b36ts`
|
|
150
|
+
- Require path changed from `ace/support/timestamp` to `ace/b36ts`
|
|
151
|
+
- Config namespace changed from `timestamp:` to `b36ts:` in YAML config files
|
|
152
|
+
- Config directory changed from `.ace/timestamp/` to `.ace/b36ts/`
|
|
153
|
+
- No backward compatibility shims provided (per ADR-024)
|
|
154
|
+
|
|
155
|
+
## [0.5.0] - 2026-02-03
|
|
156
|
+
|
|
157
|
+
### Added
|
|
158
|
+
- Sequence generation for multiple sequential IDs (`--count` / `-n` option)
|
|
159
|
+
- `ace-timestamp encode --count 10 --format ms now` generates 10 sequential ms-precision IDs
|
|
160
|
+
- `ace-timestamp encode -n 5 --format day now` generates 5 consecutive day IDs
|
|
161
|
+
- JSON output support: `--count 3 --json` outputs as JSON array
|
|
162
|
+
- `CompactIdEncoder.encode_sequence` method for programmatic sequence generation
|
|
163
|
+
- `CompactIdEncoder.increment_id` method for incrementing any format ID
|
|
164
|
+
- Overflow cascade handling for all formats (ms → 50ms → 2sec → block → day → month)
|
|
165
|
+
|
|
166
|
+
## [0.4.1] - 2026-01-31
|
|
167
|
+
|
|
168
|
+
### Added
|
|
169
|
+
- Hierarchical split format for timestamp encoding/decoding (`encode_split`, `decode_path`)
|
|
170
|
+
- CLI options: `--split`, `--path-only`, `--json` for split encoding output
|
|
171
|
+
- Auto-detection of path separators (`/`, `\`, `:`) in decode
|
|
172
|
+
|
|
173
|
+
### Performance
|
|
174
|
+
- Moved CLI integration tests to E2E test suite
|
|
175
|
+
- Tests now run via `/ace:run-e2e-test ace-support-timestamp MT-TIMESTAMP-004`
|
|
176
|
+
- Test execution time reduced from 13.93s to ~61ms (99.6% reduction)
|
|
177
|
+
|
|
178
|
+
## [0.4.0] - 2026-01-24
|
|
179
|
+
|
|
180
|
+
### Added
|
|
181
|
+
- Precision-based format names for better clarity: `2sec` (~1.85s), `40min` (40-min blocks), `50ms` (~50ms), `ms` (~1.4ms)
|
|
182
|
+
|
|
183
|
+
### Fixed
|
|
184
|
+
- **Critical**: 4-char format now correctly uses 40-minute blocks (0-35) instead of hours (0-23)
|
|
185
|
+
- This aligns with position 4 of the compact format design
|
|
186
|
+
- Time at 12:30 now encodes to block 18, not hour 12
|
|
187
|
+
|
|
188
|
+
### Changed
|
|
189
|
+
- **Breaking**: Format options renamed to precision-based names
|
|
190
|
+
- `compact` → `2sec`
|
|
191
|
+
- `hour` → `40min` (with bug fix)
|
|
192
|
+
- `high_7` → `50ms`
|
|
193
|
+
- `high_8` → `ms`
|
|
194
|
+
- Old format names are no longer accepted
|
|
195
|
+
- Default format changed from `compact` to `2sec`
|
|
196
|
+
- Updated all documentation and examples to use new format names
|
|
197
|
+
|
|
198
|
+
### Technical
|
|
199
|
+
- Renamed internal encoding/decoding methods to match precision-based names
|
|
200
|
+
- Updated all test files to use new format names
|
|
201
|
+
- Updated CLI help text with precision-based descriptions
|
|
202
|
+
- Updated fallback defaults in config resolver
|
|
203
|
+
|
|
204
|
+
## [0.3.0] - 2026-01-24
|
|
205
|
+
|
|
206
|
+
### Added
|
|
207
|
+
- Granular timestamp format templates: month (2 chars), week (3 chars), day (3 chars), hour (4 chars)
|
|
208
|
+
- High-precision timestamp formats: high-7 (7 chars, ~50ms), high-8 (8 chars, ~1.4ms)
|
|
209
|
+
- Format auto-detection for variable-length IDs (2-8 characters)
|
|
210
|
+
- `--format` option to encode CLI for specifying output format
|
|
211
|
+
- `default_format` configuration option (defaults to `compact` for backward compatibility)
|
|
212
|
+
- Day/week disambiguation for 3-char IDs using 3rd character value (0-30=day, 31-35=week)
|
|
213
|
+
|
|
214
|
+
### Changed
|
|
215
|
+
- Decode command now supports variable-length IDs with automatic format detection
|
|
216
|
+
- Updated CLI help text to reflect new format options
|
|
217
|
+
|
|
218
|
+
### Technical
|
|
219
|
+
- Added `atoms/format_specs.rb` with format specifications and detection logic
|
|
220
|
+
- Extended `CompactIdEncoder` with format-aware encode/decode methods
|
|
221
|
+
- Updated `Formats` module with patterns for all supported ID lengths
|
|
222
|
+
|
|
223
|
+
## [0.2.2] - 2026-01-16
|
|
224
|
+
|
|
225
|
+
### Changed
|
|
226
|
+
- Rename context: to bundle: keys in configuration files
|
|
227
|
+
|
|
228
|
+
## [0.2.1] - 2026-01-14
|
|
229
|
+
|
|
230
|
+
### Changed
|
|
231
|
+
- Migrate CLI to Hanami pattern (per ADR-023)
|
|
232
|
+
- Moved command classes from `cli/*.rb` to `cli/commands/*.rb`
|
|
233
|
+
- Updated namespace from `Commands::*` to `CLI::Commands::*`
|
|
234
|
+
- CLI registry updated to reference `CLI::Commands::*` classes
|
|
235
|
+
|
|
236
|
+
## [0.2.0] - 2026-01-11
|
|
237
|
+
|
|
238
|
+
### Changed
|
|
239
|
+
- **Breaking**: Gem renamed to `ace-support-timestamp` (task 202.03)
|
|
240
|
+
- Namespace changed from `Ace::Timestamp` to `Ace::Support::Timestamp`
|
|
241
|
+
- Executable remains `ace-timestamp` for backward compatibility
|
|
242
|
+
- **CLI migrated to dry-cli** (task 179.16)
|
|
243
|
+
- Replaced Thor-based CLI with dry-cli registry pattern
|
|
244
|
+
- Thor dependency replaced with dry-cli ~> 1.1 in gemspec
|
|
245
|
+
- Command classes moved to `cli/` directory as separate files
|
|
246
|
+
- Commands now use keyword arguments for options
|
|
247
|
+
|
|
248
|
+
### Removed
|
|
249
|
+
- Backward compatibility require shim (`require "ace/timestamp"`) per ADR-024
|
|
250
|
+
- Namespace alias `Ace::Timestamp` - use `Ace::Support::Timestamp` directly
|
|
251
|
+
|
|
252
|
+
## [0.1.1] - 2026-01-06
|
|
253
|
+
|
|
254
|
+
### Fixed
|
|
255
|
+
|
|
256
|
+
- Fix CLI exit code handling using standard ACE pattern (`result.is_a?(Integer) ? result : 0`)
|
|
257
|
+
- Change default CLI command from `help` to `encode` (encodes current time when no args)
|
|
258
|
+
- Fix timestamp parsing to check legacy format (YYYYMMDD-HHMMSS) before Time.parse
|
|
259
|
+
- Add configuration validation for alphabet (36 chars) and year_zero (1900-2100)
|
|
260
|
+
- Add ace-support-test-helpers to development dependencies
|
|
261
|
+
- Correct day range documentation from "0-35" to "0-30"
|
|
262
|
+
|
|
263
|
+
## [0.1.0] - 2026-01-06
|
|
264
|
+
|
|
265
|
+
### Added
|
|
266
|
+
|
|
267
|
+
- Initial release of ace-timestamp gem
|
|
268
|
+
- `CompactIdEncoder` atom for encoding/decoding timestamps to 6-character Base36 IDs
|
|
269
|
+
- `Formats` atom for detecting and parsing timestamp formats (compact vs timestamp)
|
|
270
|
+
- `ConfigResolver` molecule for ace-config cascade integration
|
|
271
|
+
- CLI commands: `encode`, `decode`, `config`
|
|
272
|
+
- Configurable `year_zero` for custom base year (default: 2000)
|
|
273
|
+
- 108-year coverage with ~1.85 second precision
|
|
274
|
+
- Chronologically sortable IDs (string sort = time sort)
|
|
275
|
+
- Comprehensive test suite
|
|
276
|
+
|
|
277
|
+
### Format Specification
|
|
278
|
+
|
|
279
|
+
- 6 Base36 characters (0-9, a-z)
|
|
280
|
+
- Positions 1-2: Month offset from year_zero (108 years of months)
|
|
281
|
+
- Position 3: Day of month (1-31 mapped to 0-30)
|
|
282
|
+
- Position 4: 40-minute block of day (36 blocks)
|
|
283
|
+
- Positions 5-6: Precision within block (~1.85s)
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michal Czyz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1> ACE - B36TS </h1>
|
|
3
|
+
|
|
4
|
+
Compact, sortable Base36 timestamp IDs for scripts, logs, and path-friendly artifacts.
|
|
5
|
+
|
|
6
|
+
<img src="https://raw.githubusercontent.com/cs3b/ace/main/docs/brand/AgenticCodingEnvironment.Logo.XS.jpg" alt="ACE Logo" width="480">
|
|
7
|
+
<br><br>
|
|
8
|
+
|
|
9
|
+
<a href="https://rubygems.org/gems/ace-b36ts"><img alt="Gem Version" src="https://img.shields.io/gem/v/ace-b36ts.svg" /></a>
|
|
10
|
+
<a href="https://www.ruby-lang.org"><img alt="Ruby" src="https://img.shields.io/badge/Ruby-3.2+-CC342D?logo=ruby" /></a>
|
|
11
|
+
<a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg" /></a>
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
> Works with: Claude Code, Codex CLI, OpenCode, Gemini CLI, pi-agent, and more.
|
|
16
|
+
|
|
17
|
+
[Getting Started](docs/getting-started.md) | [Usage Guide](docs/usage.md) | [Handbook - Skills, Agents, Templates](docs/handbook.md)
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
`ace-b36ts` encodes UTC timestamps into short Base36 IDs that preserve chronological order in plain string sorting, and decodes them back when you need readable time output. Seven encode formats range from `month` granularity down to `ms`, with a configurable `year_zero` epoch baseline.
|
|
22
|
+
|
|
23
|
+
## How It Works
|
|
24
|
+
|
|
25
|
+
1. Encode a timestamp (or `now`) into a compact Base36 ID -- from 2 characters at month granularity up to 8 at millisecond precision.
|
|
26
|
+
2. Use the ID directly in file names, directory paths (with `--split`), log entries, or automation artifacts.
|
|
27
|
+
3. Decode the ID back into a human-readable UTC timestamp for debugging, audits, or incident review.
|
|
28
|
+
|
|
29
|
+
All examples below encode **2026-03-23 12:00:00 UTC**:
|
|
30
|
+
|
|
31
|
+
| Format | Chars | Precision | Example |
|
|
32
|
+
|--------|-------|-----------|---------|
|
|
33
|
+
| `month` | 2 | month | `8q` |
|
|
34
|
+
| `week` | 3 | ISO week | `8qy` |
|
|
35
|
+
| `day` | 3 | day | `8qm` |
|
|
36
|
+
| `40min` | 4 | 40 min | `8qmi` |
|
|
37
|
+
| `2sec` | 6 | ~1.85 s | `8qmi00` |
|
|
38
|
+
| `50ms` | 7 | ~50 ms | `8qmi000` |
|
|
39
|
+
| `ms` | 8 | ~1.4 ms | `8qmi0000` |
|
|
40
|
+
|
|
41
|
+
> `day` and `week` both produce 3-character IDs. The 3rd character distinguishes them: values 0--30 in base36 encode days 1--31, while values 31--35 encode ISO weeks (Thursday determines which week a date belongs to).
|
|
42
|
+
|
|
43
|
+
## Use Cases
|
|
44
|
+
|
|
45
|
+
**Create sortable IDs for automation output** - generate compact IDs for build artifacts, log entries, and task files without long timestamp strings. Use [`ace-b36ts encode now`](docs/usage.md) for quick generation or `/as-b36ts` in agent workflows.
|
|
46
|
+
|
|
47
|
+
**Map IDs to directory paths** - use split output (`--split`) to create hierarchical paths for storage and archival workflows across [ace-assign](../ace-assign) and [ace-task](../ace-task) pipelines.
|
|
48
|
+
|
|
49
|
+
**Round-trip between compact IDs and timestamps** - decode IDs during debugging, audits, and incident review flows with [`ace-b36ts decode`](docs/usage.md).
|
|
50
|
+
|
|
51
|
+
**Embed in shell and CI pipelines** - use deterministic, timestamp-derived IDs in scripts and Ruby automation through the `Ace::B36ts` API for encode/decode helpers.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
[Getting Started](docs/getting-started.md) | [Usage Guide](docs/usage.md) | [Handbook - Skills, Agents, Templates](docs/handbook.md) | Part of [ACE](https://github.com/cs3b/ace)
|
data/Rakefile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/gem_tasks"
|
|
4
|
+
require "minitest/test_task"
|
|
5
|
+
|
|
6
|
+
desc "Run tests using ace-test"
|
|
7
|
+
task :test do
|
|
8
|
+
sh "ace-test"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
desc "Run tests directly (CI mode)"
|
|
12
|
+
Minitest::TestTask.create(:ci)
|
|
13
|
+
|
|
14
|
+
# ADR-021: Standardized task alias for CI compatibility
|
|
15
|
+
task spec: :test
|
|
16
|
+
|
|
17
|
+
task default: :test
|
data/exe/ace-b36ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require_relative "../lib/ace/b36ts"
|
|
5
|
+
require "ace/support/cli"
|
|
6
|
+
|
|
7
|
+
args = ARGV.empty? ? ["--help"] : ARGV
|
|
8
|
+
|
|
9
|
+
begin
|
|
10
|
+
Ace::Support::Cli::Runner.new(Ace::B36ts::CLI).call(args: args)
|
|
11
|
+
rescue Ace::Support::Cli::Error => e
|
|
12
|
+
warn e.message
|
|
13
|
+
exit(e.exit_code)
|
|
14
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
---
|
|
3
|
+
name: b36ts
|
|
4
|
+
description: ENCODE and DECODE timestamps to/from compact Base36 IDs
|
|
5
|
+
expected_params:
|
|
6
|
+
required:
|
|
7
|
+
- action: Action to perform (encode, decode, validate)
|
|
8
|
+
optional:
|
|
9
|
+
- value: 'Timestamp or compact ID to process'
|
|
10
|
+
- year_zero: 'Base year for encoding (default: 2000)'
|
|
11
|
+
- format: 'Output format for decode: readable, iso, timestamp'
|
|
12
|
+
last_modified: '2026-02-14'
|
|
13
|
+
type: agent
|
|
14
|
+
source: ace-b36ts
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
You are a timestamp encoding specialist using the **ace-b36ts** gem.
|
|
18
|
+
|
|
19
|
+
## Core Responsibilities
|
|
20
|
+
|
|
21
|
+
Your primary role is to work with Base36 compact timestamp IDs:
|
|
22
|
+
- Encode timestamps to 6-character compact IDs
|
|
23
|
+
- Decode compact IDs back to timestamps
|
|
24
|
+
- Validate compact ID format and semantic correctness
|
|
25
|
+
- Explain the format structure and precision
|
|
26
|
+
|
|
27
|
+
## Primary Tool: ace-b36ts
|
|
28
|
+
|
|
29
|
+
Use the **ace-b36ts** command for all timestamp operations.
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
### Encode
|
|
34
|
+
Convert timestamps to compact IDs:
|
|
35
|
+
```bash
|
|
36
|
+
# Encode current time
|
|
37
|
+
ace-b36ts encode now
|
|
38
|
+
|
|
39
|
+
# Encode specific time
|
|
40
|
+
ace-b36ts encode "2025-01-06 12:30:00"
|
|
41
|
+
ace-b36ts encode "2025-01-06T12:30:00Z"
|
|
42
|
+
|
|
43
|
+
# With custom year_zero
|
|
44
|
+
ace-b36ts encode "2025-01-06" --year-zero 2020
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Decode
|
|
48
|
+
Convert compact IDs back to timestamps:
|
|
49
|
+
```bash
|
|
50
|
+
# Decode to readable format (default)
|
|
51
|
+
ace-b36ts decode i50jj3
|
|
52
|
+
# => 2025-01-06 12:30:00 UTC
|
|
53
|
+
|
|
54
|
+
# Decode to ISO format
|
|
55
|
+
ace-b36ts decode i50jj3 --format iso
|
|
56
|
+
# => 2025-01-06T12:30:00Z
|
|
57
|
+
|
|
58
|
+
# Decode to timestamp format
|
|
59
|
+
ace-b36ts decode i50jj3 --format timestamp
|
|
60
|
+
# => 20250106-123000
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Config
|
|
64
|
+
Show current configuration:
|
|
65
|
+
```bash
|
|
66
|
+
ace-b36ts config
|
|
67
|
+
ace-b36ts config --verbose
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Format Specification
|
|
71
|
+
|
|
72
|
+
The 6-character Base36 ID encodes:
|
|
73
|
+
|
|
74
|
+
| Positions | Field | Range | Description |
|
|
75
|
+
|-----------|-------|-------|-------------|
|
|
76
|
+
| 1-2 | Month offset | 0-1295 | Months since year_zero (108 years) |
|
|
77
|
+
| 3 | Day | 0-30 | Day of month (maps to 1-31) |
|
|
78
|
+
| 4 | Block | 0-35 | 40-minute block of day (36 per day) |
|
|
79
|
+
| 5-6 | Precision | 0-1295 | Position within 40-min block (~1.85s) |
|
|
80
|
+
|
|
81
|
+
## Important Notes
|
|
82
|
+
|
|
83
|
+
- IDs are chronologically sortable (string sort = time sort)
|
|
84
|
+
- Default year_zero is 2000, covering 2000-2107
|
|
85
|
+
- Precision is approximately 1.85 seconds
|
|
86
|
+
- All times are handled in UTC
|
|
87
|
+
|
|
88
|
+
## Response Format
|
|
89
|
+
|
|
90
|
+
When providing results:
|
|
91
|
+
1. Show the input and output clearly
|
|
92
|
+
2. Explain the encoding/decoding if asked
|
|
93
|
+
3. Note any precision limitations
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: as-b36ts
|
|
3
|
+
description: ENCODE and DECODE timestamps to/from compact Base36 IDs
|
|
4
|
+
# bundle: wfi://b36ts
|
|
5
|
+
# agent: general-purpose
|
|
6
|
+
user-invocable: true
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Bash(ace-b36ts:*)
|
|
9
|
+
- Bash(ace-bundle:*)
|
|
10
|
+
- Read
|
|
11
|
+
argument-hint: "[encode|decode|config] [value] [options]"
|
|
12
|
+
last_modified: 2026-03-09
|
|
13
|
+
source: ace-b36ts
|
|
14
|
+
skill:
|
|
15
|
+
kind: capability
|
|
16
|
+
execution:
|
|
17
|
+
workflow: wfi://b36ts
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
Load and run `ace-bundle wfi://b36ts` in the current project, then follow the loaded workflow as the source of truth and execute it end-to-end instead of only summarizing it.
|