Skip to content

Commit 62e5c3a

Browse files
committed
feat(0.42.0): modality routing + real 8sync shot + dashboard codegraph deep-link
- 8sync shot: real headless-Chromium renderer (was a no-op stub); token estimate = ceil(w/28)*ceil(h/28) 28x28 patches (Opus 4.7+ pay-per-pixel). - Modality routing forced across APPEND_SYSTEM + image-routing skill + capabilities.md + --advisor: STRUCTURE -> image; code/exact/line-data -> text. Grounded: the 90% cut is DeepSeek-OCR's encoder (arXiv 2510.18234), not a PNG to Opus/GLM. Measured: STATE.md 0.87x (loses), 12k-edge codegraph ~25x (wins). - Dashboard deep-link: web/src/App.tsx reads ?page=<id> so 8sync shot .../?page=codegraph captures the real graph.
1 parent d576958 commit 62e5c3a

11 files changed

Lines changed: 357 additions & 148 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,29 @@
33
Mọi thay đổi đáng kể của `8sync` ghi vào đây. Format theo [Keep a Changelog](https://keepachangelog.com),
44
versioning theo [SemVer](https://semver.org). **8sync rule:** mỗi PR cập nhật mục `Unreleased`.
55

6-
## [Unreleased]
6+
## [0.42.0] — 2026-07-04
7+
8+
### Added — modality routing: read STRUCTURE as an image, PRECISE things as text
9+
- **`8sync shot` is now real** (was a no-op stub) — renders any URL / local HTML to
10+
PNG via system or omp's bundled Chromium (`~/.omp/puppeteer/chrome/…`), prints a
11+
vision-token estimate (`ceil(w/28)*ceil(h/28)`, 28×28 patch — no stale cap). Also
12+
fixes the `image-routing` skill which already pointed at it.
13+
- New **Modality routing** directive forced across the harness: `APPEND_SYSTEM.md`
14+
(always-on), the `image-routing` skill (rewritten with honest economics), and the
15+
`capabilities.md` snapshot, enforced per-turn by `--advisor`. Rule: vision models
16+
render a codegraph / diagram / dashboard / big PDF to ONE image (modality-fit); code /
17+
exact config / line-numbered data stay TEXT (cheaper AND lossless).
18+
- Grounded, not hyped: the 10×/90% token cut (DeepSeek-OCR, arXiv 2510.18234) needs a
19+
DEDICATED optical encoder — NOT a screenshot to Opus/GLM. Claude bills images per
20+
28×28 patch (pay-per-pixel on Opus 4.7+). Measured on this repo: STATE.md as image =
21+
0.87× (LOSES vs text); the 12k-edge codegraph as image ≈ 25× (structure win). The
22+
gate captures exactly that. OCR-Memory pattern (arXiv 2604.26622) documented: image to
23+
LOCATE, exact text to READ.
24+
- **Dashboard deep-link**`web/src/App.tsx` now reads `?page=<id>` (or `/<id>`) for
25+
the initial page (`pageFromUrl()` + `history.replaceState` on nav). Nav was in-memory
26+
only, so `8sync shot .../codegraph` used to render State; now
27+
`8sync shot http://127.0.0.1:8731/?page=codegraph` captures the real graph. `build.rs`
28+
already rebuilds the Vite bundle on `web/src` change, so a plain `cargo build` re-embeds.
729

830
## [0.41.0] — 2026-07-03
931

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["crates/cli"]
44

55
[workspace.package]
6-
version = "0.41.0"
6+
version = "0.42.0"
77
edition = "2021"
88
license = "MIT"
99
authors = ["8sync-dev <8sync.dev.1111@gmail.com>"]

agents/KNOWLEDGE.md

Lines changed: 23 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -10,107 +10,29 @@
1010
# KNOWLEDGE (8sync managed — append-only)
1111

1212
## Learnings (append-only — ghi DƯỚI đây; KHÔNG sửa block `8sync:harness` ở trên)
13-
_(consolidated → agents/archive/KNOWLEDGE-1782879675.md · agents/archive/KNOWLEDGE-1782951662.md)_
14-
- **validated: anti-forget is a 4-layer stack that *declares + reminds* but
15-
never *checks* — the missing 5th layer is a live per-turn reviewer.** Layers:
16-
(1) `APPEND_SYSTEM.md` always-on rules (never compacts), (2) `8sync-recall.ts`
17-
hook injecting skill-index + STATE at `agent-start`/`compacting`, (3) Mnemopi
18-
`retain`/`recall` + `<memories>` per-turn inject ("remind"), (4)
19-
`capabilities.md` exact tool catalog. None verify the turn just taken. omp's
20-
`--advisor` (valueless boolean flag, confirmed in omp 16.2.x `--help`) is that
21-
reviewer → now default-ON in `models.rs` `omp_flags()`/`resume_flags()`,
22-
gated off for `TaskClass::Trivial`, opt-out `8sync ai --no-advisor` /
23-
`advisor=false`. "remind" the user asked for = layer 3 (already wired), NOT a
24-
distinct omp tool (`todo` is the closest built-in).
25-
- **validated: rust-embed uses `compression` feature here** → embedded assets
26-
(`models.toml`, `APPEND_SYSTEM.md`) are compressed blobs, so `strings binary`
27-
will NOT find their text. Verify asset edits via the edit-tool output / source,
28-
and verify *flag/struct* strings (`--advisor`, `no_advisor`) which live in the
29-
code section and DO show up.
30-
- **failure→fixed: `8sync skill update`'s git-collection loop treated "no
31-
filter" as "install every sub-skill found in the repo", not "only refresh
32-
what's already registered".** Registering ONE skill from a 20-skill
33-
collection (`agents/skills.toml`'s `alpha-research` → feynman) silently
34-
installed all 19 others too, and re-added them on every bulk
35-
`8sync harness` run even after being deliberately removed from the
36-
manifest (`contributing` kept reappearing). Root cause: `want(name)` is
37-
`filter.is_none_or(|f| f == name)` — vacuously true whenever `filter` is
38-
`None`, so `url_matches || want(sname)` was always true in the bulk path.
39-
Fixed in `update.rs`'s git-source loop: a sub-skill installs only when the
40-
URL/repo-segment was explicitly targeted, its own name was explicitly
41-
filtered, OR (bulk run, filter=None) it already has a registry key.
42-
Lesson: any "install-all-from-collection" loop MUST distinguish "user
43-
explicitly asked for this whole collection" from "no filter given" —
44-
they are NOT the same thing, and conflating them lets any single
45-
registered skill from a collection silently expand into arbitrary,
46-
unrequested skills on every idempotent re-run.
47-
- **validated: 18 of feynman's 20 skills were installed as text with zero
48-
chance of running** — 14 pointed to feynman's OWN slash-commands
49-
(`prompts/*.md`, only registered inside feynman's own pi-coding-agent
50-
runtime via `extensions/research-tools.ts`), which don't exist in omp.
51-
Ported all 14 (+ 4 more with just cosmetic "Feynman" naming) to
52-
self-contained `assets/skills/<name>/SKILL.md` using omp's real tool
53-
names (`task` for feynman's `subagent`, `web_search`/`read` for
54-
`fetch_content`, `ask` for `ask_user_question`). Lesson: NEVER trust a
55-
skill's line count or presence in a registry as a proxy for it actually
56-
working in the host runtime — a skill that only makes sense inside its
57-
origin tool's own slash-command system is dead weight anywhere else.
58-
Always open the actual prompt/extension source before assuming a ported
59-
skill "just works".
60-
- **validated: Phase C/D/E loop-eng v2 (full) shipped → v0.19.0.** (C) loop section + generated
61-
block: `task` implementer↔independent verifier (verify-gate before commit, objective/boundaries/
62-
output per subagent, share-trace for dependent, parallel only independent); FAIL → `failure:` in
63-
KNOWLEDGE seed prefix, read first at session start. (D) `memory.rs` `PLAYBOOKS_TEMPLATE`
64-
`agents/PLAYBOOKS.md` (Voyager procedural memory, index by `When:`); memory tiering KNOWLEDGE/
65-
PLAYBOOKS/DECISIONS; bench spine now 6 files. (E) L1→L3 + guardrails (no auto push/PR at L3);
66-
`up.rs` per-tick job documented. Verified: PLAYBOOKS.md seeded on `harness up`, generated AGENTS.md
67-
carries Loop-discipline invariant; final bench upfront ~7,095 tok, A2 saved 81% (abs 32,308 tok),
68-
A1 PASS. Grounding: Anthropic orchestrator + Cognition share-trace + Voyager + Reflexion.
69-
- **validated: `/gs` one-command team loop shipped → v0.20.0.** New omp slash command
70-
`assets/commands/gs.md` (arg-routed: `<goal>` plan+run · bare resume · `auto` L3 · `status|next|stop`)
71-
driving the A–E loop off `agents/STATE.md`; token-lean (codegraph/cbm/headroom mandatory) +
72-
guardrails (verify-gate before commit, worktree + no push/PR at L3, hard-stop `.gs/STOP`). Modeled on
73-
gsd-pi `/gsd auto`. `deploy::ensure_gs_command(home, root?)` writes `~/.omp/agent/commands/gs.md`
74-
(global) + `<repo>/.omp/commands/gs.md` (team, committed); wired into harness auto/init/up. On-demand
75-
`gs` skill (bundled #15) documents protocol. **Key facts:** omp discovers commands at
76-
`~/.omp/agent/commands/*.md` + `<cwd>/.omp/commands/*.md` (`omp://slash-command-internals.md`),
77-
native precedence 100, body is a prompt template with `$ARGUMENTS`. Verified: `/gs` deploys both
78-
paths, valid frontmatter, gs skill on-demand (not in upfront); bench A1 PASS, upfront ~7,322 tok,
79-
A2 saved 81%. failure: gstack tool-backed roles (qa/ship) still need gstack `bin/` + deps installed.
80-
- **validated: `/gs` autonomy + hint + QA + reference submodules → v0.20.1.** (1) `/gs auto` wasn't
81-
unattended because the agent kept calling `ask` — added an **Autonomy contract** (NEVER ask in
82-
`auto`; research → assume → log under `## Assumptions` in STATE → proceed; "blocker" = only
83-
credential/external-approval/destructive). omp default `tools.approvalMode: yolo` already auto-approves
84-
tools, so the stalls were `ask`/clarifying, NOT the approval gate — a slash command can't bypass that
85-
gate anyway. (2) Hint: omp shows per-arg hints only for BUILTINS; file commands surface only their
86-
`description` — so front-loaded modes into description + added `argument-hint` frontmatter (YAML must
87-
be quoted/clean: a value starting with `[` or containing `: ` breaks the parser). (3) QA/test made
88-
first-class: per-slice verify-gate runs tests+QA, plus a mandatory **Closeout** (full suite + e2e QA +
89-
independent re-review vs DoD + handoff summary) before reporting done. (4) Added `reference/gstack` +
90-
`reference/gsd-pi` submodules. **failure: codegraph honors NO exclude — not `.gitignore` (even
91-
`index -f`), no flag, no ignore-file; populating reference/ ballooned the index to ~3k files/110MB.**
92-
Fix: commit submodule pointers but `git submodule deinit -f` the working trees (lean by default,
93-
fetch on demand); cbm DOES respect `.gitignore` (it excludes `agents/skills`), so `reference/` is
94-
gitignored as a cbm guard. Verified bare `8sync harness` = full auto-setup (MCP + skills + `/gs` +
95-
memory + inject + index) in one command; bench A1 PASS, ~7.6k upfront, A2 80%.
96-
- **validated: doc-hygiene + AI-engine health + loop correctness → v0.22.0.** (1) `harness/audit.rs`
97-
`harness_audit` + `stale_summary`: hand-rolled path scanner (no regex crate) flags STALE repo-relative
98-
doc paths, oversized docs (>400 lines / >120-line force-load block), 30d churn hotspots. **Heuristic
99-
rules that matter:** trim only TRAILING sentence punctuation (leading `.`/`/` are meaningful); SKIP
100-
absolute (`/home/…`), `~`-rooted/`<placeholder>`-derived `/…` fragments, URLs, and dotdir first-segs
101-
(`github.com`, `.cargo`) — else the harness's own machine-generated CORE paths false-positive. Wired
102-
into `doctor` (one-line summary) + `/gs` doc-hygiene. Verified: scratch repo flags only the planted
103-
`src/gone.rs`; su-code 30→4 after the skip rules. (2) `doctor::check_ai_engines(home)` enforces the
104-
token-optimization stack is installed AND registered in `~/.omp/agent/mcp.json`: codegraph 0.9.6 +
105-
codebase-memory-mcp 0.8.1 + headroom 0.27.0 (all green here). (3) **failure: codegraph STEP 0 verbs
106-
were wrong** — force-load/index/breadcrumb taught `codegraph search/deps/defs`, NONE exist; real CLI
107-
(0.9.6) = `query/callers/callees/impact/context/files/affected/sync/status`. Fixed all 3 strings.
108-
(4) **failure: a stale `~/.omp/skills/karpathy` dir beside canonical `karpathy-guidelines` (identical
109-
frontmatter `name`) double-listed the skill** (CORE + a redundant on-demand). `build_force_load` now
110-
dedups by frontmatter `name` after the rank-sort (keeps higher-ranked dir) — each logical skill once;
111-
future-proof. Note: bundled `assets/skills/karpathy/` deploys to target `karpathy-guidelines` via the
112-
explicit (asset,target) map in `deploy.rs`/`setup.rs` — dir name ≠ skill name is fine. (5) **failure:
113-
bundled `impeccable` referenced `.agents/skills/impeccable/scripts/*.mjs` (leading dot) but 8sync
13+
_(consolidated 101 dòng cũ → agents/archive/KNOWLEDGE-1783170628.md)_
14+
- **validated: "read images to save 90% tokens" is TRUE only with a dedicated optical
15+
encoder (DeepSeek-OCR arXiv 2510.18234: 10× @97%), NOT by sending a PNG to
16+
Opus/GLM.** Claude bills images per 28×28 patch = `⌈W/28⌉×⌈H/28⌉` (pay-per-pixel;
17+
Opus 4.7+ dropped the cheap ~1.15MP cap, ~3× pricier). MEASURED on this repo:
18+
STATE.md (7502 chars ≈ 1875 text tok) rendered 1200×1400 = 2150 vision tok = **0.87×
19+
(image LOSES for text)**; the 12388-edge codegraph as 1400×2200 image = 3950 vision tok
20+
vs ~99k text = **~25× (structure WINS)**. ⇒ gate: STRUCTURE (graph/diagram/dashboard/
21+
PDF/UI) → image; code/exact-config/line-data → text. Wired into APPEND_SYSTEM +
22+
image-routing skill + capabilities.md + `--advisor` enforcement. Correct memory pattern
23+
= OCR-Memory (arXiv 2604.26622): image to LOCATE, exact text to READ (never OCR precise
24+
content back out of a picture).
25+
- **validated: `8sync shot` was a no-op STUB** (like `diff-img`); made real via headless
26+
Chromium — system first, else omp's bundled `~/.omp/puppeteer/chrome/<ver>/chrome-linux64/chrome`
27+
(verified: valid PNG in 0.44s). `--virtual-time-budget=<ms>` lets SPA content render before
28+
capture (confirmed: the Vite dashboard rendered fully).
29+
- **validated: dashboard deep-link fixed** — nav was in-memory (button, no URL), so
30+
headless shot always rendered State. Added `pageFromUrl()` + `history.replaceState`
31+
in `web/src/App.tsx`: `?page=<id>` (or `/<id>`) selects the initial page. `build.rs`
32+
already rebuilds the Vite FE when `web/src` changes (`web_src_newer`) → plain `cargo
33+
build` re-embeds; server SPA-fallback serves index.html for any path so the query
34+
works headless. VERIFIED: `8sync shot .../?page=codegraph` renders the real graph
35+
(4.8k nodes/12.4k edges, 12 Leiden clusters) — flagship "shot the memory graph" live.
11436
mirrors to `agents/skills/`** — its setup scripts couldn't run; fixed 28 refs across SKILL.md + 4
11537
reference docs. Note: headroom's router PROTECTS code/recent content (`router:protected:recent_code`)
11638
→ won't compress small code samples (0 saved); it compresses genuine large logs.

agents/STATE.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ Biến 8sync/omp thành **super agent-team** token-optimal: omp = core, su-code
1515
- [x] **Dashboard redesign + Models/Projects** (v0.29.0): `8sync harness web` full impeccable redesign · Models page (view/edit routing live) · project switcher (status dots) · markdown render · serena-off fix · context honesty · workflow canvas — 14 pages, 0 console errors.
1616

1717
## Current step
18-
Enhancement (Unreleased): **advisor default-ON** — closes the last anti-forget
19-
gap. The stack had 4 layers (APPEND_SYSTEM rules · recall-hook live STATE/skill
20-
inject · Mnemopi retain/recall = "remind" · capabilities.md tool catalog) that
21-
*declare + remind* but never *check* the turn just taken. omp's `--advisor`
22-
(passive per-turn reviewer) is now passed by default from `models.rs`
23-
`omp_flags()`/`resume_flags()`; gated off for `trivial` prompts (token-optimal);
24-
opt-out `8sync ai --no-advisor` or `advisor=false` in models.toml. New `advisor`
25-
field in `ModelConfig` (default true). Docs: models.toml + APPEND_SYSTEM +
26-
`ai --help`. Built + installed to PATH; verified `--advisor`/`no_advisor` in
27-
binary + `ai --help`. CHANGELOG/KNOWLEDGE updated.
18+
Enhancement (Unreleased): **modality routing** — read STRUCTURE as image, PRECISE
19+
as text. Researched the "read-image-saves-90%" claim → grounded: 90% (DeepSeek-OCR
20+
arXiv 2510.18234) needs a DEDICATED optical encoder, NOT a PNG-to-Opus/GLM; Claude
21+
bills per 28×28 patch (Opus 4.7+ pay-per-pixel). MEASURED here: STATE.md as image
22+
= 0.87× (LOSES); 12k-edge codegraph as image ≈ 25× (WINS). Built: **`8sync shot`
23+
real** (was stub) via bundled Chromium; **Modality routing** directive forced in
24+
APPEND_SYSTEM + image-routing skill (honest econ rewrite) + capabilities.md +
25+
`--advisor`. OCR-Memory pattern (arXiv 2604.26622) documented: image to LOCATE,
26+
text to READ. Built + `8sync harness` redeployed + verified deployed content +
27+
token math. CHANGELOG/KNOWLEDGE updated.
28+
**Deferred (flagged):** dashboard nav is in-memory (button) not URL-routed, so
29+
`8sync shot .../codegraph` renders State, not the graph. Flagship "shot the memory
30+
graph" needs a frontend deep-link (`?page=` → initial route) + bun/vite rebuild +
31+
re-embed. Not yet started — awaiting user go-ahead.
2832

2933
## Previous (Unreleased, shipped earlier this session)
3034
Shipped 2 fixes (Unreleased): **(1) zai-vision MCP + skill**`8sync harness`

0 commit comments

Comments
 (0)