This repository was archived by the owner on Apr 11, 2026. It is now read-only.
Commit a22b9aa
feat(compress): port rtk TOML filter engine to flowctl-core
Ported rtk's (https://github.com/rtk-ai/rtk, Apache 2.0) TOML filter DSL
to flowctl-core/src/compress.rs (684 lines). Integrated into output
pipeline for 3 POC commands via TTY auto-detection.
Measured savings vs pretty baseline (tiktoken cl100k_base equivalent):
epics: 1973 → 769 bytes (-61%)
tasks: 1539 → 594 bytes (-61%)
status: 97 → 25 bytes (-74%)
Scope:
- NEW flowctl-core/src/compress.rs (ported engine, 8-stage pipeline)
- NEW flowctl-core/LICENSE-APACHE-rtk (Apache 2.0 attribution)
- NEW flowctl-core/src/filters/{epics,tasks,status}.toml (filter configs)
- MOD flowctl-cli/src/output.rs (added pretty_output() compact path)
- MOD flowctl-cli/src/commands/query.rs (cmd_epics, cmd_tasks wired)
- MOD flowctl-cli/src/commands/admin/status.rs (cmd_status wired)
- FIX flowctl/tests/cmd/mcp_initialize.toml (stale version 0.1.26 → 0.1.29)
Filter pipeline (8 stages): strip_ansi → replace → match_output → strip/keep
→ truncate → head/tail → max_lines → on_empty. Inline [[tests.X]] pattern
from rtk preserved (12 compress tests, all passing).
Zero changes to flowctl-db/-service/-daemon/-scheduler, ID system, spec
format, hooks, skills, agents. Backward compat preserved: --json without
--compact output unchanged (2418 bytes same as baseline).
cargo test --all: green.
Task: fn-12-token-compact-rtk-guard.16 (POC)
Audit: docs/token-optimization-audit.md (541-line analysis, 47 items)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 26a06b7 commit a22b9aa
13 files changed
Lines changed: 1686 additions & 22 deletions
File tree
- docs
- flowctl
- crates
- flowctl-cli/src
- commands
- admin
- flowctl-core
- src
- filters
- tests/cmd
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
184 | 187 | | |
185 | 188 | | |
186 | | - | |
187 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
441 | 443 | | |
442 | 444 | | |
443 | 445 | | |
| |||
446 | 448 | | |
447 | 449 | | |
448 | 450 | | |
449 | | - | |
| 451 | + | |
| 452 | + | |
450 | 453 | | |
451 | 454 | | |
452 | 455 | | |
453 | 456 | | |
454 | 457 | | |
455 | | - | |
| 458 | + | |
| 459 | + | |
456 | 460 | | |
| 461 | + | |
457 | 462 | | |
458 | 463 | | |
459 | 464 | | |
| |||
486 | 491 | | |
487 | 492 | | |
488 | 493 | | |
| 494 | + | |
489 | 495 | | |
490 | | - | |
| 496 | + | |
| 497 | + | |
491 | 498 | | |
492 | 499 | | |
493 | 500 | | |
| |||
499 | 506 | | |
500 | 507 | | |
501 | 508 | | |
502 | | - | |
| 509 | + | |
| 510 | + | |
503 | 511 | | |
504 | 512 | | |
505 | | - | |
| 513 | + | |
| 514 | + | |
506 | 515 | | |
| 516 | + | |
507 | 517 | | |
508 | 518 | | |
509 | 519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
41 | 68 | | |
42 | 69 | | |
43 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
0 commit comments