Repository navigation
0.1.0
Added
- Cargo workspace with two crates,
crates/ddc-coreandcrates/ddc-adapters, sharing workspace lints:unsafe_codedenied; clippyunwrap_used,expect_usedandpanicwarned, withunwrap/expectallowed in tests. ddc-coredomain model:VcpCodewith named MCCS codes,VcpValue,MonitorId,MonitorInfo,Feature(kind, access, risk, allowed values),Confirm,FeatureReadingandDdcError.- Seed risk table (
risk_for_code): brightness, contrast, color preset, RGB gains, volume, sharpness and OSD language areSafe; every other code, including unclassified ones, isDangerous. Capabilities::parse, an in-house, tolerant parser for MCCS capabilities strings, tested against the real string of the "RTK QHD HDR" dev monitor.- Ports
MonitorBackend(driven) andMonitorControl(driving), andSoftwareOsd, which implementsMonitorControl: capabilities cached per monitor, reads never filtered or blocked by the capabilities (unreadable ones count as declaring nothing), and writes guarded by risk confirmation and value validation, then read back. A write whose maximum is not known yet reads the feature once first, whether or not the capabilities declare the code; if that read fails, nothing is written. InMemoryMonitorBackendinddc-adapters: a scripted fake monitor backend with a call log, used by the core's use-case tests.DdcHiMonitorBackendinddc-adapters: the real DDC/CI backend overddc-hi0.4.1 (dxva2on Windows,/dev/i2c-*on Linux, nonvapi/macOS backends), behind the default-on crate featureddc-hi.- It runs on a single worker thread that owns every monitor handle, so it is
Send + Syncwithoutunsafe; a static assertion checks this on every target. - Callers wait per-operation budgets (
DdcHiBudgets: 1 s VCP read/write, 8 s capabilities, 5 s enumeration) and getTimeoutpast them. A job whose caller gave up never reaches the monitor. - No call needs an
enumerate()first: an unknown monitor id costs one enumeration under the enumeration budget, then the call runs under its own budget; an id still missing answersMonitorNotFound. - Failed transactions are retried up to 3 times within the budget, 200 ms apart for VCP reads and writes and 500 ms apart for capabilities reads, then answer
Transport. A VCP code the monitor answers as unsupported (DDC/CI result code0x01) is not retried and answersUnsupportedFeature(Linux;dxva2on Windows keeps that reply to itself). When one more enumeration still fits the rest of the budget (capabilities reads, with the defaults), the monitor is looked up again first, so an unplugged one answersMonitorNotFound. VCP reads and writes skip that check, so a display with mute DDC/CI fails in about 0.4 s. MonitorIds come from EDID (manufacturer-model-serial), else from the device description, elseindex-N, with a#Nsuffix on repeats. Enumeration never probes DDC/CI.- VCP replies map to
current/maxin VESA MCCS byte order. Capabilities replies lose every NUL byte and are decoded lossily.
- It runs on a single worker thread that owns every monitor handle, so it is
FakeMonitor::with_transient_capabilities_failures, to script capabilities reads that fail before succeeding.- Read-only hardware tests (
crates/ddc-adapters/tests/real_monitor.rs),#[ignore]d and gated byDDC_HW_TESTS=1. docs/linux-ddc-setup.md: libudev build headers, loadingi2c-dev, udevuaccessori2cgroup permissions, why never to usesudo, and the proprietary NVIDIA driver caveat.ddc-cli, the command-line binary (crates/ddc-cli):list,caps [--refresh],get <vcp>andset <vcp> <value> [--yes], with--monitorselection (exact id,listindex, or a unique case-insensitive part of an id; never a guess) and--jsonoutput.<vcp>takes decimal,0xhex, or the shortcutsbrightness,contrast,input,preset,volumeandpower.- Dangerous writes need
--yes, decided by the core; there is no prompt. The value read back after a write is printed, with a warning when the monitor ignored it. A code the capabilities do not declare can be written too, such asvolumeon the dev monitor: the core reads its maximum first. - Exit codes: 0 success, 2 usage, 3 monitor selection, 4 invalid feature or value, 5 unconfirmed dangerous write, 6 transport or timeout. A code the monitor refuses as unsupported exits 4, not 6, for
getandset.
CachingMonitorBackendanddefault_cache_dir()inddc-adapters: capabilities strings kept on disk per monitor id (%LOCALAPPDATA%\ddc-control\caps,$XDG_CACHE_HOME/ddc-control/capsor~/.cache/ddc-control/caps), so a warmddc-cli getskips the ~2.5 s capabilities read. Only successful reads the core can parse are stored.invalidatebackscaps --refresh: the file is replaced only by a successful re-read, so a refused refresh keeps it.FakeMonitor::with_vcp_failure, to script a VCP code whose reads and writes fail with a given error.- MCCS feature catalog in
ddc-core(domain::mccs_catalog): one static table of the 39 VCP codes observed on the "RTK QHD HDR" (28 declared, 9 answered without being declared,0xE6/0xF1found by a full read-only scan), each with its MCCS name, CLI name, kind, access, risk and value names, plus the lookups built on it (catalog_entry,catalog_codes,value_name,value_for_name,code_for_alias,hertz,version_from_u16,interpret). MonitorControl::probe_undeclared_featuresandProbedFeature: reads, once each, every catalogued code the capabilities do not declare, telling a code the monitor refuses (UnsupportedFeature) from one it does not answer (Transport/Timeout); one failure never stops the probe, and nothing is written.ddc-cli features [--probe] [--json]: every declared feature with its current value, kind, access, risk and meaning;--probeadds the catalogued codes the capabilities leave out, markednot supported by this monitorornot responding(probe_statusin JSON).ddc-clinames:<vcp>takes any catalog name (sharpness,osd-language,red-black-level,v-frequency…), and<value>takes value names, ignoring case and punctuation (set preset srgb,set preset 6500k,set input hdmi-1 --yes). A name that is no value of the feature being set exits 2 before any monitor is touched.getandsetshow what a value means (1 (0x01) sRGB,514 (0x202) 2.2); JSON gainsvalue_name/interpretedonly when there is one.ddc-cli reset <factory|brightness-contrast|geometry|color> [--yes], the same write asset <code> reset --yes:0x01to0x04/0x05/0x06/0x08, refused without--yes(exit 5), reported as sent since the reset codes are write-only.ddc-tray(apps/ddc-tray), a Tauri 2 system-tray app over the same core, backend and capabilities cache asddc-cli, installed from the release packages (below) or run withcargo run -p ddc-tray.- A 360×560 popup, hidden on focus loss and Esc: brightness, contrast and volume sliders, color preset, input source, power mode, and an "All settings" section loaded on demand, with a read-only probe of the codes the capabilities leave out.
- Sliders write 80 ms after the last move, coalesced, one write in flight per feature; the popup shows the value the monitor reads back.
- Every dangerous change (input, power, dangerous "All settings" entries) goes through a confirmation dialog first;
Confirm::Yesis built only in the app's command layer. - Several monitors: a selector; the popup opens on the last monitor it loaded, else the first whose panel loads. A panel fails when none of its quick controls can be read, so a monitor whose DDC/CI is mute is skipped and marked "(no DDC/CI)" in the selector.
- On Linux the icon is a StatusNotifierItem of the app's own, over
ksni(pure Rust on D-Bus; no AppIndicator library, at build or run time): a left click toggles the popup, the mouse wheel changes the brightness by 5% per notch (0–100%, notches that arrive during a write coalesced into one write), and a right click opens the menu. Its tooltip names the monitor the wheel and the menu act on. - On KDE Plasma under Wayland the popup opens next to the tray icon, inside the screen's work area, with no taskbar entry: the app loads a KWin script over D-Bus at start and unloads it when it quits, through Quit or on SIGTERM, SIGINT or SIGHUP (which quit the app the same way), waiting at most 2 s for KWin; only a SIGKILL or a crash leaves it loaded, matching only the dead process's popup, and the next start replaces it. The script is written only to
$XDG_RUNTIME_DIR; without it none is loaded. Elsewhere the popup opens where the compositor puts it. - Tray menu in English or Brazilian Portuguese, from the system's locale: "Open panel" and "Quit", plus brightness shortcuts 0/25/50/75/100% on Linux. On Windows (Tauri's tray icon) a left click toggles the popup anchored above the icon (not built on Windows yet).
- Lists (monitor selector, color preset, "All settings" lists) are drawn inside the popup, keyboard operable as a WAI-ARIA select-only combobox: a native select's menu is a window of its own, and the popup hid as soon as it opened.
- Popup in English or Brazilian Portuguese, every text from locale keys; light and dark themes; keyboard operable; strict CSP, tested as Tauri embeds it, with any platform config merged; capabilities limited to the app's own commands; single instance.
- The CSP check covers the effective policy of Linux, Windows and macOS alike, each merged as Tauri's build merges it for that target (
the_effective_csp_is_the_strict_policy_on_every_target), and atauri.<platform>.conf.jsonmust not touchapp.security: the policy lives only intauri.conf.json, and the test fails a platform file that changescspor sets adevCsp. - On Linux, a restart at launch with WebKitGTK's DMA-BUF renderer off (
WEBKIT_DISABLE_DMABUF_RENDERER=1) unless the variable is already set: that renderer crashed the app on NVIDIA under Wayland. - A browser demo of the popup (
?demo=rtk|two-monitors|empty|error, and&fail=write,features,probeto make those commands time out as a mute monitor does,events,hideto have listening to the tray and hiding the popup refused as Tauri refuses a command) without Tauri, on a local dev server only (localhostor127.0.0.1; elsewhere, as inside the app should the Tauri API be missing, the popup reports the backend unavailable, never simulated values), checked by a Playwright + axe suite (no console errors, no critical/serious accessibility violations, no native<select>in any state, light and dark, also after a change, All settings and a probe that time out, and after listening to the tray or hiding the popup is refused; a mouse drag of the brightness slider writes nothing while it moves and once, the last value, after the release) that also takes the README screenshots;node --testsuites for the UI modules, including one that fails any literal text the scripts put into the page instead of an i18n key, and one that fails any phrase in a string or template of the scripts outside the locale files and the demo's data; a demo-only pseudo-locale (?pseudo=1: every translated text between⟦and⟧, the monitor's own names, value names, codes and messages markedtranslate="no") and a Playwright check, in 27 states and both themes (the failures and waits included, with a state for every toast the scripts show, which anode --testcheck keeps so, and for every confirmation dialog), that fails any visible text or readable attribute that is neither, or that has a letter outside the marks; a demo-only guard that logs a console error, which fails any Playwright test, for a text the page shows that no translation produced and that is not markedtranslate="no"; golden JSON contracts shared by the Rust and JS tests (the RTK, and a mute monitor's panel error); a StatusNotifierItem smoke script, whose--activatealso clicks the icon over D-Bus and requires the popup to show and stay shown, and whose--fake --scrollrolls the wheel over the icon against a simulated monitor (DDC_TRAY_FAKE=1: the RTK of the contract, in memory, never a real monitor) and requires one brightness step per vertical notch and none for a horizontal one;DDC_TRAY_DEBUG=1diagnostics on stderr, including each brightness write from the tray (ddc-tray: brightness 75 -> 80); and#[ignore]d hardware tests: one safe brightness change, restored, and a read-only check that a mute monitor fails its panel, both refusing to run on the simulated monitor.
- Continuous integration (
.github/workflows/ci.yml) on every pull request, every push tomainand on demand, through the reusable workflows of slipalison/github-workflows:rust-linux(ubuntu-22.04):cargo fmt --check,cargo audit,cargo clippy --all-targets --all-features -D warnings, the tests undercargo llvm-covwith the 80% line floor (82.93% on 2026-09-27), andcargo build -p ddc-tray --release --locked;rust-windows(windows-latest): the same without the audit; the first build and test run of the Windows code, all 11 test binaries passing,ddc-tray's included;node-ui:npm testinapps/ddc-tray(161node --testtests, 138 Playwright tests);versao: the next version computed from the Conventional Commits, with no tag or release.
.cargo/audit.toml: thecargo auditpolicy, four advisories ignored (RUSTSEC-2018-0005, RUSTSEC-2024-0370, RUSTSEC-2024-0320, RUSTSEC-2024-0429), each with the dependency path, why ddc-control does not reach the affected code and when to check it again.npm testinapps/ddc-trayruns thenode --testsuites (TAP), installs Playwright's Chromium and runs the Playwright suite. Only a GitHub-hosted runner gets the browser's system libraries (--with-deps); elsewhere the browser goes to the user's cache, never withsudo.- Release packages built by CI on every pull request and push, from the same jobs that test: the deb, the rpm and the AppImage of
ddc-trayon Linux, its MSI and NSIS installer on Windows, each named after the product in lower case with the version and no space (ddc-control_0.1.0_amd64.deb), in the artifactspacotes-rust-linuxandpacotes-rust-windows. ddc-clirelease archives:ddc-cli-x86_64-unknown-linux-gnu.tar.gzandddc-cli-x86_64-pc-windows-msvc.zip, each with the binary andLICENSEonly.- Automatic GitHub Release: a push to
mainthat passes every quality job and brings a commit calling for a new version creates the tagv<version>and the release, with the seven packages attached, aSHA256SUMSof them and this file's section above the commit notes. A push to anensaio-release/*branch creates the same release as a draft, with no tag; a pull request never publishes. - The deb and the rpm install the udev
uaccessrule ofdocs/linux-ddc-setup.mdas/usr/lib/udev/rules.d/60-ddc-control-i2c.rulesand loadi2c-devat boot through/usr/lib/modules-load.d/ddc-control.conf; their post-install loads the module and reloads udev, best effort. The AppImage cannot install them. - The AppImage is built only from pinned tools: its entry point (
AppRun),linuxdeploy, the AppImage output plugin and the AppImage runtime come from fixed releases with their sha256 checked, and CI fails if the bundler downloads anything else or if the AppImage does not start with the checked runtime.
Changed
- Write risk comes from the catalog, and any code outside it stays dangerous.
0x0C(color temperature) and0x6C/0x6E/0x70(black levels) can now be written without--yes. Read-only codes (0x0B,0x52,0xAC,0xAE,0xB2,0xB6,0xC6,0xC8,0xC9,0xDF,0xFD,0xFF) are refused as not writable (exit 4) instead of asking for--yes(exit 5). - A non-continuous feature whose capabilities list no values (a preset or OSD language with unreadable capabilities, an input source a monitor does not list) no longer accepts any value up to the maximum it reports: it is checked against the catalog's value names, and refused when there are none (
0x02). 0x1E(auto setup) and0xCA(OSD/button control) are written only with their MCCS values, still with--yes:00Off,01Run,02Continuous for0x1E;01OSD disabled,02OSD enabled for0xCA, with the button byte always zero. Before,0xCAtook any value up to the maximum the monitor reported.set_featurerefuses read-only andTablefeatures before reading anything, reads a maximum only for continuous features, and never reads a write-only feature: no maximum, no read-back, the value sent is returned.Capabilities::featuretakes kind and access from the catalog, for declared and undeclared codes alike.ddc-clilabels every catalogued code by its catalog name in text and in JSONname(0x87 sharpness:); the six names of earlier versions are unchanged. TheSHORTCUTStable andshortcut_nameare gone.- VCP reads and writes are retried 200 ms apart instead of 50 ms: read back to back, the RTK sometimes failed a read three times in a row 50 ms apart, which made a random code of
features --probereadnot respondingin 3 of 4 runs; at 200 ms, 0 of 4. Three attempts still fit the 1 s VCP budget; a display with mute DDC/CI now fails a read in about 0.4 s instead of 0.1 s. - The workspace version is
0.0.0: CI stamps the version computed from the commits into the release build and the packages, andddc-cli --versionbuilt locally says0.0.0. - CI's
rust-linuxjob runs on Ubuntu 22.04 instead ofubuntu-latest, so the Linux packages run on glibc 2.35 and newer (Ubuntu 22.04, Debian 12, Mint 21 and later). ddc-trayis no longer build-from-source only: it ships as the deb, rpm, AppImage, MSI and NSIS packages above.
Fixed
- A panic inside
ddc-hi(ddc-i2c0.2.2 indexes out of bounds on the RTK's reply to0x7E) ended the backend's worker thread, and every later call in the process failed. Now only that call fails, as a transport error, and the worker keeps serving. - On Linux a late reply to an earlier read could pass for the answer to the next code (
features --probeshowed0x7Ewith0x70's value); a reply for another code is now refused and the read retried. ddc-tray's test binaries would not start on Windows (STATUS_ENTRYPOINT_NOT_FOUND, tauri-apps/tauri#13419): tauri-build puts the Common Controls v6 manifest only in the app binary. The build script now hands the same manifest to the linker for every binary of the crate onwindows-msvctargets. Fixed before the tray's first Windows build, whose CI run passed all of its tests.
Removed
- The placeholder hello-world binary at the repository root.
0.1.0
Primeira versão: 19 commit(s) desde o início do repositório.
Novidades
- ddc-backends: real DDC/CI backend over ddc-hi (re-land of #2) (#6) (2628f8c)
- full-osd-control: MCCS catalog, features, names and reset (#7) (1bca909)
- tray-app: system tray app for Linux and Windows (#8) (c352118)
- ci-crossbuild: CI on Linux and Windows via reusable workflows (#10) (07323e5)
- release-packaging: packages and automatic GitHub Release (#11) (8156ae1)
Manutenção
- scaffold Rust binary crate (971f677)
- jdi: install JDI runtime for Claude Code (pt-BR) (468ad10)
- repo: normalize line endings to LF via .gitattributes (e2fd31f)
- jdi: initialize ddc-control (91ef01d)
- jdi: lock D-2 core dependencies and align PROJECT.md (1bd1686)
- jdi: bootstrap specialists for ddc-control (52d9f8e)
- jdi: install specialist copies for Claude Code (4a6a6f9)
- hooks: add commit-msg guard and JDI pre-commit gate (9f181a1)
- add README with dev setup and commit rules (0dbe270)
- jdi: document commit hooks in doer conventions (a318794)
- repo: relax Claude Code permission settings (#4) (3006dfc)
- jdi: ship core-domain through tray-app (#9) (e72790d)