Commit graph

743 commits

Author SHA1 Message Date
Arena Agent
1cb6ad289b docs(nigig-site): record SITE-00 and SITE-01 publication
Some checks are pending
nigig-site / Owned paths and honest test contracts (push) Waiting to run
nigig-site / Cargo check-all-targets (push) Waiting to run
nigig-site / Cargo clippy-site-owned (push) Waiting to run
nigig-site / Cargo contained-media-export-fixtures (push) Waiting to run
nigig-site / Cargo containment-storage-crypto (push) Waiting to run
nigig-site / Cargo integration-non-live (push) Waiting to run
nigig-site / Cargo production-dependency-containment (push) Waiting to run
nigig-site / Cargo unit (push) Waiting to run
nigig-site / Runtime UI (explicitly skipped until enabled) (push) Waiting to run
nigig-site / Migration and recovery (explicitly skipped until enabled) (push) Waiting to run
nigig-site / Real server interoperability (explicitly skipped until enabled) (push) Waiting to run
nigig-site / Media limits (explicitly skipped until enabled) (push) Waiting to run
nigig-site / Security and supply-chain baseline (push) Waiting to run
nigig-site / Release capability gate (push) Waiting to run
repo hygiene / hygiene (push) Waiting to run
2026-09-12 15:50:05 +00:00
Arena Agent
5d2d890f70 feat(nigig-site): enforce SITE-01 fail-closed containment
Some checks failed
nigig-build (CAD) / full-crate-check (push) Waiting to run
nigig-build (CAD) / doc-workspace-coverage (push) Waiting to run
nigig-build (CAD) / cad-widget-coverage (push) Waiting to run
nigig-build (CAD) / cad-engine-coverage (push) Waiting to run
nigig-map / test (push) Waiting to run
sms / android (push) Waiting to run
sms / nigig-sms (push) Waiting to run
sms / supply-chain (push) Waiting to run
sms / gates (push) Waiting to run
sms / robius-sms (push) Waiting to run
spreadsheet / engine-coverage (push) Waiting to run
spreadsheet / ui-controller-coverage (push) Waiting to run
traffic / gates (push) Waiting to run
traffic / nigig-traffic (push) Waiting to run
traffic / supply-chain (push) Waiting to run
nigig-site / Owned paths and honest test contracts (push) Has been cancelled
nigig-site / Cargo check-all-targets (push) Has been cancelled
nigig-site / Cargo clippy-site-owned (push) Has been cancelled
nigig-site / Cargo contained-media-export-fixtures (push) Has been cancelled
nigig-site / Cargo containment-storage-crypto (push) Has been cancelled
nigig-site / Cargo integration-non-live (push) Has been cancelled
nigig-site / Cargo production-dependency-containment (push) Has been cancelled
nigig-site / Cargo unit (push) Has been cancelled
nigig-site / Runtime UI (explicitly skipped until enabled) (push) Has been cancelled
nigig-site / Migration and recovery (explicitly skipped until enabled) (push) Has been cancelled
nigig-site / Media limits (explicitly skipped until enabled) (push) Has been cancelled
nigig-site / Real server interoperability (explicitly skipped until enabled) (push) Has been cancelled
nigig-site / Security and supply-chain baseline (push) Has been cancelled
nigig-site / Release capability gate (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
Contain production capabilities, remove the production sync surface, and keep legacy media/export/transport implementations test-only.

Require authenticated existing-key storage with preservation-first recovery and sticky write disablement, backed by deterministic fault and concurrency tests plus dependency and workflow contracts.
2026-09-12 15:46:30 +00:00
Arena Agent
f49d8b16ac ci(nigig-site): establish truthful SITE-00 gates
Some checks failed
nigig-site / Owned paths and honest test contracts (push) Has been cancelled
nigig-site / Cargo check-all-targets (push) Has been cancelled
nigig-site / Cargo clippy-site-owned (push) Has been cancelled
nigig-site / Cargo integration-non-live (push) Has been cancelled
nigig-site / Cargo media-export-baseline (push) Has been cancelled
nigig-site / Cargo storage-crypto-baseline (push) Has been cancelled
nigig-site / Cargo unit (push) Has been cancelled
nigig-site / Runtime UI (explicitly skipped until enabled) (push) Has been cancelled
nigig-site / Migration and recovery (explicitly skipped until enabled) (push) Has been cancelled
nigig-site / Media limits (explicitly skipped until enabled) (push) Has been cancelled
nigig-site / Real server interoperability (explicitly skipped until enabled) (push) Has been cancelled
nigig-site / Security and supply-chain baseline (push) Has been cancelled
nigig-site / Release capability gate (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
2026-09-12 09:08:22 +00:00
Arena Agent
672fdd54b7 style(nigig-site): establish SITE-00 formatting baseline
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
2026-09-12 09:04:00 +00:00
Arena Agent
bae671f357 docs(nigig-traffic): add correctness remediation execution plan
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
traffic / gates (push) Has been cancelled
traffic / nigig-traffic (push) Has been cancelled
traffic / supply-chain (push) Has been cancelled
2026-09-12 07:59:51 +00:00
Arena Agent
16a98334f1 docs(nigig-site): add security remediation execution plan
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
2026-09-12 07:59:51 +00:00
Arena Agent
5297c94180 docs(nigig-build): add audited remediation execution plan
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
2026-09-12 07:59:51 +00:00
Arena Agent
4665973b57 docs(cad-ui): add audited remediation execution plan
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
2026-09-12 07:59:51 +00:00
Arena Agent
3666c6ce3a docs(cad-core): add audited remediation execution plan
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
2026-09-12 07:59:51 +00:00
e899a271c6 feat(pdf): shading port test (12 passed) + function updates
Some checks failed
PDF engine / engine (push) Waiting to run
PDF engine / makepad-integration (push) Waiting to run
PDF engine / fuzz (push) Waiting to run
repo hygiene / hygiene (push) Has been cancelled
2026-09-12 09:22:48 +03:00
cea969cce5 feat(pdf): function module updates
Some checks failed
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
2026-09-12 09:14:08 +03:00
c66a8ec9db docs+test(site,pdf): assessment update + font_info port cases
Some checks failed
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
Verified: font_info_port 22 passed.
2026-09-12 08:55:20 +03:00
5614121eae feat(site+pdf): report editor video + font ports
Some checks failed
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
- nigig-site: video module, report editor WYSIWYG updates.
- pdf-graphics: colorant_raster, font_text, unicode_names modules +
  colorant raster port test; font + font_info test updates.
Verified: nigig-site + pdf-graphics check clean; pdf-graphics tests
all pass (20 suites, 0 failures).
2026-09-12 08:45:35 +03:00
2142e1834b fix(nigig-site): report editor WYSIWYG wiring for new makepad API
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
- Use WidgetRef::borrow_mut/borrow directly for the DocEditor host
  (new Widget derive: borrow has no generics on refs, as_* only on
  WidgetRefExt; WidgetExt blanket impl covers View lookups).
- Semicolon fix for RefMut temporary lifetime in set_rich_mode.
2026-09-12 08:22:43 +03:00
a620609ff9 feat(cad-ui): sun position controls
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
2026-09-12 07:21:51 +03:00
ac8f8aa002 chore: sync full working tree to gitdab
Some checks failed
Payment domain, storage, platform and UI / isolated-payment-tests (push) Waiting to run
Payment domain, storage, platform and UI / payment-ui-tests (push) Waiting to run
repo hygiene / hygiene (push) Has been cancelled
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
traffic / gates (push) Has been cancelled
traffic / nigig-traffic (push) Has been cancelled
traffic / supply-chain (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-map / test (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
Whole-tree sync: cad-core/cad-ui split sources, nigig-build
construction_frame migration, pdf port progress, mpesa/pay/uikit/doc
updates, workspace members/profiles/lock, CI workflows and reviews.
See individual file history for details.
2026-09-12 07:15:24 +03:00
338b8c818f fix(android): enable cad-ui on mobile + new-API fixes
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
- nigig-build: cad-ui + construction_frame back on unconditionally.
  The host-only gate is dropped: cad-ui now compiles for aarch64, and
  pageflipnav mobile needs ConstructionScreen / BuildProjectsPage
  (CAD/Docs/Spreadsheet buttons) — gating produced the white screen.
- cad-ui: ScriptVmHost for standalone eval (no more vm.std / () host),
  std::thread workers (Cx::spawn_thread removed upstream).
- viewport: same worker fix + section_state helper for the CPU cull path.
- script_bindings: new script/geometry binding module.
- spreadsheet grid + invoice Walk literals: ..Default::default() for
  new aspect/cell/deferred fields; explicit style::CellAlign import
  (makepad added its own CellAlign).
Verified: pageflipnav aarch64 release links with 0 errors; APK built,
installed (54M) and running with home screen drawing.
2026-09-12 00:26:43 +03:00
5ae5d5a84c fix(android): gate cad-ui host-only + port map to new makepad API
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
nigig-map / test (push) Has been cancelled
- nigig-build: cad-ui + construction_frame host-only (DO NOT enable
  unconditionally: CadViewport Script derive fails ScriptApply for
  aarch64 and breaks every pageflipnav android build).
- map: vendor TagThreadPool (removed upstream with the task-pool
  scheduler) into thread_pool.rs; Walk literals gain
  ..Default::default() for new aspect/cell/deferred fields.
Verified by pageflipnav aarch64 release rust build (0 errors).
2026-09-11 08:46:05 +03:00
b1045d79d4 feat(pdf): graphics/document port progress + android gates
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
- pdf-graphics: new cff, truetype, cjk_cmap, disk_cache, document_ai,
  path, reflow, text_diff modules + port tests (all green); syntax/type
  fixes for the aarch64 build (stray brace, &u8 derefs, f2dot14 assign).
- pdf-document: ocr, pdf_a, xmp modules + roundtrip tests; annotation
  editor updates.
- pdf-makepad: handle RenderCommand::SetOverprint (report via
  TransparencyError per ADR 0009, no silent drop); renderer/page_view
  updates for the new recording ops.
- matrix_client: nimanyatta native module (ungated; the aarch64 wrapper
  needs it unconditionally).
- pageflipnav home_screen: project_store sync is host-only until
  cad-ui's Widget Script derive is fixed for aarch64.

Verified: cargo check on all four crates clean at fork 66cc4f15f;
nigig-pdf-graphics tests pass; pageflipnav aarch64 release links.
2026-09-11 05:09:11 +03:00
f177df8d43 chore(deps): bump makepad fork rev to 66cc4f15f (fix broken widgets merge)
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
nigig-map / test (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
b9a083c26 carried an upstream merge that dropped enter_isolate /
leave_isolate / IsolateEntry from widget_async while lib.rs and
apps/flow-ui + apps/wm still use them, breaking makepad-widgets.
66cc4f15f restores them (verified: makepad-widgets, makepad-app-flow-ui,
makepad-wm check clean). Urgent follow-up to c901f1d which pinned the
broken rev.
2026-09-10 19:21:21 +03:00
c901f1d4f1 chore(deps): bump makepad fork rev to b9a083c26 + workspace updates
Some checks failed
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
nigig-map / test (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
Fork nigig-makepad-test-android now at b9a083c26 (upstream merge +
robot secondary-dex bundling + app_main wrapper fix, on top of the
game-libs/arcade port). All 16 workspace makepad revs follow.

Also takes the in-tree workspace updates: exclude nested
crates/nimanyatta workspace, add crates/apps/nigig-site member, and
PERF-OPS Phase 1 profile tuning (thin LTO + engine opt-level 3).
cad-core/cad-ui split and nigig-traffic members stay WIP.
2026-09-10 16:36:11 +03:00
12dff81b05 fix(build): make cad-ui host-only for Android
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
cad-ui's Widget Script derive (CadViewport) needs LiveHook fix for
aarch64; until then, gate it behind cfg(not(target_os="android"))
in nigig-build so pageflipnav's aarch64 wrapper (which pulls
nigig-build) can link without cad-ui. Host builds still include
cad-ui. Unblocks pageflipnav aarch64 release.
2026-09-08 22:28:11 +03:00
075d775e9f fix(robius-ussd): fix Android JNI getPackageName handling for new jni crate
Some checks failed
Payment domain, storage, platform and UI / isolated-payment-tests (push) Has been cancelled
Payment domain, storage, platform and UI / payment-ui-tests (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
JString::from(JObject) + get_string borrowing was incorrect for
aarch64 android target (jni 0.21): JavaStr doesn't impl Display and
temporary JObject dropped while borrowed. Store package_obj in local
and use JString::from(package_obj). Fixes pageflipnav android build
which pulls robius-ussd via pageflipnav -> nigig-build -> cad-ui.
2026-09-07 03:50:53 +03:00
366b80dd16 refactor(pageflipnav): use AndroidManifest.xml.template and dedup robius java
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
- Rename resources/android/AndroidManifest.xml -> AndroidManifest.xml.template
  so the current cargo-makepad (template-based, not --manifest flag) picks
  up the custom manifest with permissions/services (ussd, sms, trigger).
  Old --manifest flag was removed in makepad's android/mod.rs; template
  is now the supported override.

- Remove duplicate java at resources/android/java/robius/{sms,trigger,ussd}
  (7 files). These are now compiled via their owning crates' build.rs
  (robius-sms/src/sys/android/*.java, robius-trigger/src/android/*.java,
  robius-ussd/src/sys/android/*.java) producing secondary dex that
  cargo-makepad bundles. Keeping them in the app caused duplicate sources
  and is not needed; java belongs in the respective crates.
2026-09-07 03:02:06 +03:00
f1eecd3c97 chore(deps): bump makepad fork rev to 435135ed5 (port game libs + arcade)
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
nigig-map / test (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
Fork nigig-makepad-test-android now at 435135ed5: reintroduces
libs/game (assets, audio, blocks, coedit, gen, net, pkg, render,
script, session) + apps/arcade reconciled to fork's libs/sim +
splash_storage jail model; arcade AI rewritten to makepad-ai-hub
ChatProvider worker (CAD pattern). nigig-build verifies.

Includes makepad-game-* workspace deps at new rev (traffic WIP
gated on this merge). cad-core/cad-ui split remains WIP.
2026-09-06 03:12:48 +03:00
95b89cf8d3 chore(deps): bump makepad fork rev to 531114e84 (rebase onto latest kerja/dev via 493d23a76)
Some checks failed
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
nigig-map / test (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
2026-09-03 11:47:02 +03:00
212abe6e8b refactor(cad): port AI subsystem from makepad-ai Agent API to makepad-ai-hub worker-thread ChatProvider model (adopt upstream example/cad), bump makepad fork rev to 7bddebb
Some checks failed
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
nigig-map / test (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
2026-09-03 08:39:07 +03:00
560116189c fix(cad-build): land CAD workspace on project dashboard, not a blank editor
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
The CAD dashboard's CadDashboard node never realized as a widget, so
tapping 'CAD Workspace' opened to a blank/editor-only sheet. Empirical
device dumps showed the first child after the root realizes reliably
while a sibling placed after the editor AdaptiveView does not, and a
root ':=' widget child alone never realizes here.

- Place dashboard_layer as the FIRST direct child of CadWorkspaceBase,
  wrapping mod.widgets.CadDashboard so it is a reliably-realizable,
  togglable View layer (matching the working doc workspace pattern).
- Wrap the editor AdaptiveView in editor_layer (a plain View) and toggle
  editor_layer/dashboard_layer visibility from apply_dashboard_visibility
  instead of toggling the AdaptiveView variants, which always draw their
  active variant regardless of visible.
- Add use mod.widgets.* to the CadDashboard script_mod (matches the
  CadEditorSheet registration that realizes inside this workspace).
- Add regression test candlands_on_dashboard asserting the dashboard
  title and + New Project button land when opening the workspace.
2026-09-02 09:06:20 +03:00
3a3db4efa6 feat(robius-notification): iOS via UNUserNotificationCenter, and the Apple/Windows logic comes out of the cfg blocks
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-map / test (push) Has been cancelled
p2p-intel / engine (push) Has been cancelled
p2p-intel / notifications (push) Has been cancelled
p2p-intel / coverage (push) Has been cancelled
p2p-intel / makepad-app (push) Has been cancelled
p2p-intel / exchange-tab (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
Two gaps remained on the Apple and Windows side after the last commit, and
they are different in kind.

The first was a missing backend. iOS returned PermanentlyUnavailable with a
note saying it was not implemented. It now uses UNUserNotificationCenter --
the only option there, since every iOS process is bundled, so the
Objective-C exception that rules that API out on macOS cannot occur. The
objc2-user-notifications bindings are real and fetchable, so this
type-checks for aarch64-apple-ios against the actual framework, and the
module was confirmed genuinely reachable by injecting a type error and
watching the target build fail.

Its is_available() returns a constant false, and that is a limit worth
naming rather than burying. The real answer comes from
getNotificationSettingsWithCompletionHandler:, which is asynchronous -- it
hands the settings to a block on an arbitrary queue. A synchronous
is_available() could only produce that by blocking on a completion handler,
which on the main thread is a deadlock rather than a delay. Returning false
errs toward telling the user delivery is unverified; the alternative is
claiming an availability the platform never confirmed, which is the whole
failure this crate was written to remove. A correct answer needs an async
entry point, which is a change to the public API rather than a bug fix, so
it is recorded in the ADR instead of being quietly wrong.

The second gap is subtler and, I think, the more valuable fix. The Apple and
Windows backends contain pure logic -- XML escaping, tag clamping -- that
was sitting inside #[cfg(target_os = "windows")], where cargo test on the
only available machine could never reach it. Those functions had zero tests
and no prospect of any.

They now live in src/payload.rs, which is cfg-free and runs on every target.
Eleven tests cover them, and they cover exactly the rules a compiler cannot:
an unescaped `&` in a merchant name makes the toast XML malformed and
Windows discards the whole notification rather than showing a mangled
character, and the Binance P2P book is full of `&`. A byte-wise truncation
of the 64-character tag limit panics outright on the full-width names that
book also contains -- so the clamp cuts on character boundaries, pinned by a
test that would panic if anyone changed it back.

One test pins something deliberately counter-intuitive: escaping is not
idempotent, and escape_xml("&") is "&". That is correct, and the
test exists so nobody "fixes" double-escaping by teaching the function to
detect already-escaped input, which is precisely how escaping filters grow
holes.

The distinction this commit is really about: the last one made the Apple and
Windows backends *compile*, which catches wrong selectors -- it found
CreateToastNotifier(&HSTRING), which does not exist. It could not catch
wrong behaviour. Extracting the logic is what makes the behaviour testable
on a machine that will never run either platform.

62 tests, up from 51. Clippy clean with -D warnings on all five targets:
linux-gnu, linux-android, apple-darwin, apple-ios, windows-msvc. p2p-intel
unchanged at 225.
2026-09-01 20:10:50 +00:00
3ef182414e feat(robius-notification): real macOS and Windows backends, type-checked against the actual frameworks
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
p2p-intel / engine (push) Has been cancelled
p2p-intel / notifications (push) Has been cancelled
p2p-intel / coverage (push) Has been cancelled
p2p-intel / makepad-app (push) Has been cancelled
p2p-intel / exchange-tab (push) Has been cancelled
The previous commit refused to write these two, on the grounds that code no
compiler has ever seen is not an implementation -- it is plausible-looking
text that would sit in the same crate as tested code and be read as equally
finished. That reasoning holds. The premise behind it did not.

`cargo check` needs the *target's standard library*, not a linker or a
platform SDK. `rustup target add x86_64-pc-windows-msvc aarch64-apple-darwin`
puts the real `windows` and `objc2` crates -- genuine WinRT metadata, genuine
Objective-C class definitions -- in front of the type checker on a Linux
host. So both backends are now written and both compile against the
frameworks they call.

Compile-checking earned its place immediately. The Windows backend was
written against `ToastNotificationManager::CreateToastNotifier(&HSTRING)`,
which does not exist: the AUMID overload is `CreateToastNotifierWithId`.
Nothing short of a compiler holding the real metadata would have caught
that, and it would have shipped looking entirely correct.

Because a cfg-gated module can silently compile to nothing -- leaving a
green check that proves only that the module was skipped -- each backend was
verified to be genuinely reachable by injecting a type error and confirming
the target build failed. Both macOS and Windows were checked this way, then
restored.

Two platform decisions worth recording.

macOS uses NSUserNotification, not UNUserNotificationCenter, and that is a
deliberate downgrade to a deprecated API. `UNUserNotificationCenter.current()`
raises an Objective-C exception when the process has no bundle identifier;
that unwinds through Rust frames and aborts. A plain `cargo run` host has no
bundle, so the modern API would crash the caller instead of reporting
unavailable -- which is worse than deprecated. The nil check on
`defaultUserNotificationCenter` is there for the same reason: msg_send on nil
returns zero rather than crashing, so every later call would silently do
nothing, which is precisely the failure this crate exists to remove.

Windows requires the host to supply an AppUserModelID, because a library
cannot invent one. It comes from an MSIX manifest or a Start Menu shortcut,
and a fabricated id produces a notifier that constructs happily and then
fails at Show. `set_app_user_model_id` is therefore public, a no-op off
Windows so portable hosts call it unconditionally, and `is_available()` is
false with a reason naming exactly what is missing until it is called. Toast
payloads are XML, so text is escaped -- the same bug class as the Telegram
MarkdownV2 escaping p2p-intel needed before it dropped Telegram, and a
merchant nickname containing `&` is not hypothetical.

The support table now has two columns, "compiles" and "executed", because
they are different claims. All four backends compile; only Linux has posted
a notification. iOS remains unavailable by design: it needs UN* with a
bundle and an entitlement, which is an app-packaging concern rather than
something this crate can satisfy.

Off Windows the module defines no entry points at all rather than stubs.
Clippy was right to call them dead: sys/mod.rs dispatches elsewhere, so they
existed only to satisfy a symmetry nothing needs.

CI gains a step that clippies all four cross-targets with -D warnings, so a
cfg-gated backend cannot rot unnoticed -- which is exactly how the
CreateToastNotifier mistake would have survived.

51 tests, clippy clean on five targets, p2p-intel still at 225.
2026-09-01 18:54:57 +00:00
e16d1d1d44 feat(robius-notification): a zero-dependency D-Bus notifier, and p2p-intel's last limit closes on Linux
Some checks failed
p2p-intel / engine (push) Has been cancelled
p2p-intel / notifications (push) Has been cancelled
p2p-intel / coverage (push) Has been cancelled
p2p-intel / makepad-app (push) Has been cancelled
p2p-intel / exchange-tab (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
nigig-map / test (push) Has been cancelled
ADR 0035 left one of p2p-intel's four limits open: no OS notification
backend, so alerts stopped when the window closed. The seam existed with one
implementation that truthfully did nothing. This is the crate that fills it.

Posting a notification on Linux is one D-Bus method call. Three ways to make
it were measured rather than assumed: notify-rust with libdbus is twelve
crates but a C library, which needs pkg-config and breaks the Android and
iOS cross-compile this crate family keeps clean; notify-rust with zbus is
pure Rust and 169 crates including an async executor; writing the wire
format out is about 250 lines and nothing at all. robius-sms deleted polkit
and gio for exactly this reason -- its E9 note records they were the sole
source of two RUSTSEC advisories and an LGPL question for every consumer --
so pulling a 169-crate tree back into the same family for one method call
would reverse that decision for a worse reason.

The cost of hand-rolling is that the protocol has to be exactly right, and a
mistake makes the daemon disconnect with no diagnostic. That cost was paid
in tests: the suite starts a private dbus-daemon per test and talks to it.
This matters more than it sounds. The marshaller and the parser were written
from the same reading of the specification, so them agreeing with each other
proves only that I was consistently wrong or consistently right; only a
third party can say which.

It found three bugs no unit test would have.

The first is the one worth dwelling on. Every error reply parsed as success.
The header-field walk assumed all fields were strings, but REPLY_SERIAL is a
u32, and reading its four bytes as a string length desynchronised the cursor
so ERROR_NAME was never reached. `post` returned Ok against a bus with no
notification service running. That is precisely the bug this crate was
written to eliminate -- a notifier that reports success and delivers nothing
-- reintroduced by accident inside its own parser. I cannot think of a
stronger argument for testing against something you did not write.

Second, is_available() was true on a bare bus, because NameHasOwner
*succeeds* and answers false in its body; checking only for an error
reported a working notifier on a machine with no notification daemon.

Third, replies were not correlated. The bus sends NameAcquired unprompted
right after Hello, so "read the next message" consumed a signal and treated
it as the answer. Replies are now matched on REPLY_SERIAL, and a single read
carrying several messages is walked rather than truncated.

The suite also serialises every test that mutates DBUS_SESSION_BUS_ADDRESS
behind a mutex. The variable is process-wide and cargo runs tests in
parallel threads; three consecutive parallel runs are now green.
--test-threads=1 would have made the failures go away too, and would have
hidden a real hazard from whoever reads the file next.

On the four platforms, honestly. Linux is implemented and tested. Android is
implemented and *compiles* -- cargo check and clippy both pass for
aarch64-linux-android -- but has never run on a device, and the module says
so in its first paragraph. It handles the two things Android drops silently,
missing POST_NOTIFICATIONS on API 33+ and a missing channel on API 26+,
because both are the same accepted-and-discarded failure this crate exists
to remove.

Apple and Windows are deliberately not written. Neither could be compiled
here -- no macOS or Windows toolchain and no way to add one -- and objc2
message sends or WinRT calls that no compiler has ever seen are not an
implementation. They are plausible-looking text that would sit in the same
crate as tested code and be read as equally finished. Both return
PermanentlyUnavailable with a reason naming ADR 0036, and their module docs
record the call sequence so the next person starts from a design rather than
a blank file. The support table says "written" and "verified" in separate
columns for the same reason.

p2p-intel's dashboard now uses SystemNotifications instead of
UnavailableNotifications. The latter stays: on a platform with no backend it
is still the truthful answer, and a test needs something that reliably
cannot deliver. Alerts are tagged per fiat so a market replaces its own
previous notification rather than stacking -- a 30-second poll would
otherwise fill the shade, and a full shade is what makes someone turn
notifications off for the app entirely, which costs more than the feature is
worth. Two new tests pin the invariant that a sink must never report
delivery it did not achieve.

CI gains a notifications job that installs dbus and sets
ROBIUS_NOTIFICATION_REQUIRE_DBUS=1. The bus-backed tests skip when
dbus-daemon is absent so the suite stays green on a bare machine, but a
silent skip in CI would mean the integration tests quietly stopped running
while the build stayed green. I verified the guard fails by hiding
dbus-daemon behind a stub that exits 127.

50 tests in the new crate, 225 in p2p-intel, clippy clean on host and
Android, and the app still starts under Xvfb.
2026-09-01 18:43:07 +00:00
da326142bf fix(pay-ui): stop re-setting ussd/phone-perm toggles on refresh so manual user state is preserved
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
Payment domain, storage, platform and UI / payment-ui-tests (push) Has been cancelled
Payment domain, storage, platform and UI / isolated-payment-tests (push) Has been cancelled
2026-09-01 21:40:49 +03:00
1d8b3a6053 merge(local): reapply local WIP onto merged main -- cad dashboard/explode/script_parts/xray merged with remote Phase-5 LOD, plus doc-ui extraction, spreadsheet xls-import, android ussd, camera and test work
Some checks failed
makepad-table / model (push) Has been cancelled
makepad-table / widget (push) Has been cancelled
makepad-table / hygiene (push) Has been cancelled
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
Payment domain, storage, platform and UI / isolated-payment-tests (push) Has been cancelled
Payment domain, storage, platform and UI / payment-ui-tests (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
nigig-map / test (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
2026-09-01 21:13:52 +03:00
159f3c7fee Merge remote-tracking branch 'origin/main' 2026-09-01 20:31:44 +03:00
8bf62e2644 feat(p2p-intel): the exchange tab becomes spread intelligence, with rails, drift capture, and three of four limits closed
Some checks failed
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
nigig-map / test (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
p2p-intel / engine (push) Has been cancelled
p2p-intel / coverage (push) Has been cancelled
p2p-intel / makepad-app (push) Has been cancelled
p2p-intel / exchange-tab (push) Has been cancelled
The exchange tab in nigig-mpesa and nigig-pay was a swap mock-up -- Sell/Buy
cards showing hardcoded ETH and AAVE at $38,409.24, wired to nothing -- above
six rate labels, each built from the *first* cached advert for its exchange:

    Binance P2P: USDT BUY @ 129.92 KES  min 1000 max 200000  via BANK

That is a price, not an opportunity. It never compared the two sides of the
book, said nothing about whether the counterparty could be dealt with, and
ignored what it costs to move the money. Against the live KES book it would
have shown a 134.60 advert from a merchant with three completed trades.

Both pages now run the p2p-intel analyzer over the adverts the app already
caches. No new endpoint, no new traffic, api.rs untouched -- the data was
always there, nothing was being asked of it. The two files are
byte-identical and CI now fails if they drift apart, which they already had
once: data.rs differs between the apps by 188 lines of tests one copy has
and the other does not.

**Rails, because a spread alone is a lie.** 29 bps on a 10,000 KES trade is
29 KES of gross margin; M-Pesa Send Money costs 55 KES a leg, 110 round
trip. The trade is deeply negative and the spread says nothing about it.
rail.rs prices every route and ranks by what survives. M-Pesa fees come from
the published Safaricom bands in robius_ussd::mpesa_bands -- real tariff
rows, not estimates, and flat rather than percentage, which is exactly why
the same spread is ruinous at 500 KES and fine at 200,000. Both legs are
charged. An amount outside the tariff reports OutOfRange and an
unconfigured bank reports Unknown; neither reports zero, because zero is a
claim and it is the wrong one. Bank tariffs ship unconfigured for the same
reason: every bank differs and there is no table to default to.

**API drift capture.** These endpoints are internal and undocumented. When
one changes the symptom is an empty panel -- indistinguishable from a quiet
market -- and the response that broke it is gone by the time anyone looks.
Every parse failure is now recorded with the payload excerpt that caused it
and copyable as a plain-text report. Deduplicated, because a 30-second poll
against a changed endpoint fails 120 times an hour and 120 identical rows is
a log nobody reads; the excerpt is excluded from the equality check, since
two responses differing only in advert ids are the same drift. The exported
header states that it carries response excerpts only and never a request,
credential or account number -- the type can only be constructed from a
response body, so that is enforced rather than promised. Cutting the excerpt
is done on character boundaries: Binance really returns names like
BennyBoss and a byte slice would panic mid-character.

The repo's other clipboard code (nigig-build's crdt_widget.rs) answers a
Hit::TextCopy, which is the query-driven path the platform uses for Ctrl+C
on a focused widget. Right for a text editor, wrong for a button exporting a
report the user never selected, so this uses cx.copy_to_clipboard and
confirms in the UI -- a copy button with no feedback is one people press
three times.

On the four limits, the honest scoreboard is two closed, one usefully
sidestepped, one open. ADR 0035 records why, because rounding all four up to
"addressed" would have been the easy write-up and the wrong one.

The poll timer and the host clock are closed outright. cx.start_interval
delivers the tick as an ordinary UI-thread event, so there is no runtime and
nothing to join at shutdown, and the interval reads through
effective_poll_seconds so the fifteen-second floor still applies -- a config
file cannot be used to hammer a rate-limited endpoint, which a test pins by
name. Staleness is now shown, because a price from four minutes ago is not a
price. One ambiguity is recorded rather than hidden: last_scan_ms == 0 is the
"never scanned" sentinel, so a scan whose timestamp genuinely is 0 reads as
never. That only happens when the host clock is broken, which is exactly
when the UI should not claim the data is current.

The headless-backend limit is sidestepped, and the distinction matters
enough to write down. Xvfb is a real X11 server that draws into memory, so
the app gets the display it insists on and tools/test-p2p-app-smoke.sh runs
the real binary end to end. That earned its place immediately: it caught
`Row = <View> { ... }`, which is not valid in this fork's script language
and which cargo build is entirely silent about, because script_mod! is
parsed at *runtime* -- a broken widget tree compiles perfectly and then
renders nothing. The gate greps for [E] in the log for that reason; the
process exits 0. I verified it fails by reintroducing the bad syntax. What
it still cannot do is drive widgets: makepad_test's Selector::id(..).click()
needs the harness to own the event loop, so the six #[ignore]d interaction
tests stay ignored.

OS notifications stay open. There is no robius-notification crate beside
robius-sms and robius-ussd, and Makepad exposes none on any target; building
one means NotificationCompat on Android, UNUserNotification on iOS and a
D-Bus call on Linux. What shipped is the seam plus one implementation named
UnavailableNotifications -- named for what it is, because a DefaultNotifier
that silently discarded every alert would read like a working feature at
every call site. is_delivering() returns false and the UI shows the reason,
so the user is told that alerts stop with the window instead of assuming
they are covered. A no-op reporting success is the exact "declared versus
delivered" failure ADR 0017 exists to prevent.

223 tests, coverage 97.03% with fifteen per-file floors -- seven of them new
and all measured, after I noticed an earlier edit had silently failed to
apply and the new files were being counted in the total but gated by
nothing. CI gains the Xvfb smoke job and an exchange-tab job that builds
both host apps and diffs their pages.
2026-09-01 16:07:43 +00:00
fefde1ecca refactor(p2p-intel): Makepad's HTTP stack, in-app alerts, and micro_serde -- serde and reqwest are gone
Some checks failed
p2p-intel / engine (push) Has been cancelled
p2p-intel / coverage (push) Has been cancelled
p2p-intel / makepad-app (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
Three changes that turn out to be one change: the app now uses the
platform's own facilities instead of carrying its own. Networking moves to
Cx::http_request, alerting moves into the UI, and deserialisation moves to
makepad_micro_serde. The default dependency graph drops from serde +
serde_derive + serde_json + toml + reqwest + rustls + tokio + hyper to
**twenty-five crates total**, none of which is any of those.

Networking follows nigig-mpesa/src/pages/exchange/api.rs: build an
HttpRequest, hand it to Cx::http_request keyed by a LiveId, match the reply
in handle_network_responses. There is no HTTP client, no TLS stack and no
async runtime in this workspace any more. That is not only leanness -- on
Android and iOS the platform stack is the only one that works without
shipping a second TLS implementation, so the `live` feature that gated
reqwest has been deleted rather than made default.

Correlating replies is where the real trap was. A scan of five markets puts
ten requests in flight and the replies come back in whatever order the
network gives them, so the LiveId has to say which market and which side.
RequestKey encodes both plus a generation counter and round-trips through a
u64 with the high bit set, so a LiveId Makepad derived from a name is never
decoded as a scan reply, and a late reply from a previous round is dropped
instead of folded into fresh data. Six tests cover the codec, including the
one that matters most: the two sides of one market must not share an id, or
the second reply overwrites the first and every spread is measured against
itself.

The transport allowlist is lifted from the nigig-mpesa review, which reached
the same conclusion I would have: Makepad exposes no certificate pinning --
its only TLS control is set_ignore_ssl_cert, which weakens verification --
so what is enforceable at this layer is that only HTTPS to p2p.binance.com
can be dialled at all. The tests cover the two ways a naive check leaks: the
lookalike host p2p.binance.com.evil.example, which passes any starts_with
test, and the userinfo smuggle https://p2p.binance.com@evil.example/, which
resolves to evil.example while reading as Binance.

Telegram is gone, as asked, and the app alerts itself: a banner, an unread
badge on the status line, an Alerts tab holding the history, and a chime.
Removing it removes a bot token from the threat model entirely -- a token in
a config file is a bot anyone who reads the file can drive -- and removes a
second network dependency from a tool already gated on one endpoint. One
test now records the *absence* of a bug rather than its fix: Twin_traders00
is a real merchant from the live capture, and its underscore previously had
to be escaped or Telegram rejected the whole message with a 400 and
delivered nothing. Rendering in our own UI deletes that failure mode, and
the test asserts the name appears unescaped.

The trade-off is stated in the README rather than glossed: an in-app alert
only reaches you while the app is running. No OS notification is raised, so
a minimised window is a missed alert.

The chime is synthesised rather than bundled -- a two-note rising blip
generated at the device's sample rate, which is a few dozen lines instead of
an audio asset shipped on three platforms, and which can therefore be
tested. It is, and the tests found the bugs you would expect from writing
audio: a freshly rendered chime starts *finished* so opening the output does
not announce itself at startup, both note edges fade so neither clicks, the
tail pads with silence rather than replaying whatever the buffer last held,
and a nonsense sample rate falls back instead of panicking. Rising rather
than falling because a falling interval reads as a dismissal and this is an
invitation to act.

The micro_serde migration surfaced two behaviours that differ from serde and
both bit before they were understood.

**micro_serde is strict by default.** deserialize_json errors on the first
key it does not model. Binance sends about forty fields per advert and we
model eight, so the strict parser cannot read the response at all -- and for
a config file it means an older build cannot open a file written by a newer
one. Everything uses deserialize_json_lenient, and a test pins that the
strict call *would* have failed, because the two differ by one word and the
strict one looks more correct.

**There is no #[serde(default)].** Optional config entries are modelled as
Option<T> on a Raw* struct and resolved into the real Config by hand. A few
more lines in exchange for two fewer dependency trees. config.toml became
config.json for the same arithmetic: micro_serde has no TOML reader, and
toml depends on serde, so a single config file would have dragged all of
serde back in through the back door.

Also worth recording: DeJsonErr implements Debug but not Display, and Debug
is the variant carrying line and column, so every error path formats it with
{e:?} deliberately rather than by accident.

CI gains a check that fails the build if reqwest, tokio, rustls, hyper,
serde, serde_derive, serde_json or toml reappears in the default graph. I
verified it fails by adding serde back to p2p-core and watching it match
serde_derive, then reverted. A gate that cannot fail is decoration.

136 tests in the default feature set and 36 more with --features ui,
including the RequestKey codec, which cannot be measured by the coverage job
because it lives behind the feature that needs Makepad. Coverage 96.92% with
ten per-file floors, up from eight -- chime.rs at 100% and client.rs at
95.69% are new. The desktop binary was built and linked to prove the app
half is real.
2026-09-01 09:37:20 +00:00
eaeebd3910 feat(p2p-intel): Binance P2P spread intelligence, shaped by what the live book actually contains
Some checks failed
p2p-intel / engine (push) Has been cancelled
p2p-intel / coverage (push) Has been cancelled
p2p-intel / makepad-app (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
nigig-map / test (push) Has been cancelled
sms / gates (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
A new nested workspace under crates/apps/p2p-intel: six engine crates, a
CLI, and a Makepad dashboard that builds for desktop, Android and iOS. It
reads public P2P adverts, measures the spread that is actually fillable,
alerts when one is worth acting on, and tracks what the float really cost.

It never places an order. Binance publishes no P2P trading API, and
automating an escrow release is how a merchant loses their float to
chargeback fraud. This is the intelligence layer; execution stays manual.

The design came from a live capture rather than a sketch, and the capture
contradicted the sketch three times. All three are now pinned by tests
against checked-in real payloads.

**The best price is routinely the least fillable one.** In the KES book the
top sell advert was 134.60 from a merchant with three completed trades,
implying a 3.6% spread; the next was 130.30. Another advert showed a 0%
completion rate. A best-price scan with no quality floor does not find
opportunities, it finds outliers, and outliers on a P2P book are bait or a
merchant about to run dry. QualityFilter defaults to 95% completion and 50
orders, and analyse() reports every exclusion with its reason rather than
dropping it silently.

The honest consequence is recorded in the integration suite: at those
defaults **not one sell-side advert in the captured KES book qualified**.
There was no fillable arbitrage. A tool that reported the raw best-price
number would have sent its user after a trade that does not exist, so the
test asserts best_sell is None and net_bps is None rather than asserting a
comfortable number.

**tradeType is inverted between request and response.** Asking the endpoint
for tradeType "BUY" returns adverts whose own adv.tradeType reads "SELL".
Both are correct: the request parameter is what you want to do, the response
field is what the advertiser is doing. Conflating them inverts every spread
and the result still looks plausible, which makes it the most expensive
mistake available here. Side keeps the two apart with
request_trade_type()/advert_trade_type(), and a test asserts they are never
equal.

**An empty market answers HTTP 200 with success: true.** NGN returned zero
adverts. "No ads" and "no answer" need opposite responses, so
is_empty_market() is a named predicate and ScanError separates Malformed
(Binance changed the payload; retrying makes it worse) from Network
(transient). basis_points_above returns None against a zero base rather than
an infinity, so an empty book cannot read as an infinite opportunity at 3am.

Money is never a float, following the rule in nigig-pay-domain/src/money.rs.
IEEE 754 cannot represent 0.1 and a spread is a difference of two nearly
equal numbers, which is exactly where binary floating point loses the digits
that matter. Binance sends prices as decimal strings, so Price parses them
straight into scaled i128 integers and never passes through f64. i128 rather
than i64 because the intermediate in a bps calculation overflows, not the
result. Excess precision is refused rather than rounded and a thousands
separator is refused rather than dropped: "1,299.92" read as 129992 is a
1000x error that still looks like a price. Tests pin 0.1 + 0.2 == 0.3 and
rotate 100 round trips at one price asserting exactly zero P&L.

Alerting is mostly restraint. At a 30-second poll one wide spread would fire
120 identical messages an hour, and a channel that cries wolf gets muted, at
which point the tool has negative value because the user believes they are
covered. AlertGate suppresses repeats inside a cooldown and re-alerts early
only when the spread improves materially -- a collapsing spread is not worth
waking someone for. Telegram MarkdownV2 escaping is tested against a real
merchant name from the capture, Twin_traders00, whose underscore would
otherwise make Telegram reject the message with a 400 and deliver nothing.

Writing the dashboard view model found a bug in my own comparator: sorting
descending by swapping the tuple to (b, a) also silently swaps the meaning
of the None arms, which put dead markets at the top of the opportunity list.
The test that caught it was written first and named for the behaviour, not
the implementation.

Networking is behind a non-default `live` feature, so an ordinary cargo test
cannot make a request and CI never depends on Binance being reachable. A CI
step asserts reqwest is absent from the default dependency graph so this
cannot regress quietly. A live scan was run once to confirm the fixtures
match reality; it reported a negative spread for KES and an empty NGN book,
which is the tool working correctly.

Conventions follow the repo rather than the generic layout in the request:
.forgejo/workflows/p2p-intel.yml rather than .github, and no Dockerfile,
since the stack is pure Rust and nothing else here is containerised.
error_set is used instead of anyhow, matching nigig-core. The root
Cargo.toml excludes the nested workspace by name, as it already does for
makepad_table, so the isolation is intentional rather than dependent on a
table inside someone else's manifest.

106 tests, coverage 96.86% with per-file floors enforced by
tools/test-p2p-coverage.sh. Both the total and per-file gates were verified
to actually fail by running them with impossible floors; a gate that cannot
fail is decoration. Two files are excluded and only because they were first
emptied of decisions: the Makepad widget, which needs a GPU and a windowing
backend this repo has no headless backend for, and the CLI main, which is
argument parsing and println. Every rule the widget renders lives in
view_model.rs, measured at 97%. That split is deliberate --
spreadsheet-ui/grid.rs once hid 36 pure functions behind a file-level
exclusion, and excluding a file you have not emptied of logic is how that
happens.

The Makepad desktop binary was built and linked in the sandbox to prove the
app half is real and not just a compiling stub.
2026-09-01 09:13:43 +00:00
c7c0ec7582 makepad: centralize fork deps in workspace + bump to 4a166606c
Declare the 12 makepad crate deps once in root [workspace.dependencies]
pointing at the gitdab fork rev 4a166606c (which now also carries
[workspace.dependencies] into the android wrapper manifest). Member
crates switch to workspace = true; 5 non-member workspaces get an inline
rev bump. Fix 9 nigig-app script_mod indent errors surfaced by the newer
upstream macro parser.

The fork rev includes: NIGIG test-mode forwarding, custom AndroidManifest
hook, ortho camera support, and the wrapper workspace-deps fix.
2026-08-28 10:49:41 +03:00
cbce585eb4 perf(cad): complete 2D and 3D LOD -- Phase 5
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
The first Phase 5 tranche correctly reduced sub-pixel 2D outlines, but it stopped short of the plan's full level-of-detail phase. Complete the phase by applying the same measured three-pixel policy to the 3D path.

Visible 3D parts below the projected AABB threshold now use one shared unit-cube geometry with an axis-aligned world-bounds transform. Full-detail shape batches, proxy instance rows and proxy draw calls are reported separately. Wireframe and hidden-line overlays use the same policy, and selected or hovered parts remain full detail.

Extend the host-testable projection and proxy policy tests, frame benchmark, source guards and documentation. Keep the real GPU/window visual check explicit: compilation, policy arithmetic, submission structure and coverage pass here, but this environment cannot execute Makepad's draw submission.
2026-08-26 16:25:45 +00:00
a5ba719d8d perf(cad): add measured sub-pixel LOD to the 2D path -- Phase 5
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
Phase 4 reduced the number of tessellation calls, but it left the geometry volume unchanged: a zoomed-out 2,000-part plan still queued a full outline for every visible part. At the measured 200 m site view a 1 m part is only about 2.7 logical pixels across, so the remaining geometry was not resolvable detail.

Add a pure lod policy that projects plane extents into logical pixels, keeps selected and hovered parts full detail, and conservatively falls back to a full outline for malformed state. The renderer and CadViewport::frame_budget call the same policy. Ordinary sub-pixel parts use one bounded 2x2 filled marker, while FrameBudget reports full outlines, markers, strokes and fills separately.

Also fold the remaining 2D 1.2 margins into render_budget::VIEW_MARGIN, extend the structural benchmark and coverage harness, correct the phase documentation, and explicitly leave 3D mesh LOD deferred until a real GPU/window measurement justifies a second geometry policy.
2026-08-26 15:40:02 +00:00
7a55f99c3a Merge remote-tracking branch 'origin/main' 2026-08-26 18:04:15 +03:00
6f3a96cf8f perf(camera): persistent preview texture + area-scoped redraw; add native Video-path variant
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
- camera_widget: allocate the preview texture once and update it in place
  via Texture::set_data_u32 instead of creating a new texture every frame;
  replace full-tree view.redraw with cx.redraw_area over the feed region.
- camera_frames (new): duplicate of camera_widget migrated to makepad's
  native Video path (set_source_camera + begin_playback, Auto preview mode)
  so per-frame app work drops to zero; photo capture uses a short-lived CPU
  frame tap opened only between shutter press and first frame.
2026-08-24 23:34:14 +03:00
8d33b6edb8 perf(camera): persistent preview texture + area-scoped redraw; add native Video-path variant
- camera_widget: allocate the preview texture once and update it in place
  via Texture::set_data_u32 instead of creating a new texture every frame;
  replace full-tree view.redraw with cx.redraw_area over the feed region.
- camera_frames (new): duplicate of camera_widget migrated to makepad's
  native Video path (set_source_camera + begin_playback, Auto preview mode)
  so per-frame app work drops to zero; photo capture uses a short-lived CPU
  frame tap opened only between shutter press and first frame.
2026-08-24 23:33:28 +03:00
4cbb155cb7 perf(cad): stroke per group, not per item -- Phase 4 of the render plan
Some checks failed
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
A 2,000-part plan view with everything on screen cost 2,270 tessellation
calls a frame. It now costs four: two for the grid, two for the parts.

`stroke()` tessellates the whole accumulated path and clears it --
`tessellate_path_stroke` ends in `path.clear()` -- so queueing many
subpaths and stroking once is one tessellation instead of N. The idiom
was already in this file: `queue_dashed_line` has done it for the axis
grid since Phase 3.9, guarded by a test. Phase 4 applies it to the two
loops that never adopted it.

**Base grid: two passes, two strokes.** Minors queued and stroked at
0.55, majors at 1.6 -- the stroke width is the one thing that genuinely
needs its own call. `GridRange::has_minor_lines`/`has_major_lines`
decide whether a pass runs at all and `frame_budget` counts strokes with
the same two predicates, because an empty `stroke()` still enters the
tessellator and a budget that assumed two when the renderer made one
would be wrong in the direction that hides work. Minors stroke first so
majors land on top where they cross; same colour either way, so the only
visible difference is that the thicker line wins a crossing, which is
the right answer.

**Parts grouped by colour.** New `batching::ColorKey` -- the bit pattern,
because `f32` is not `Hash` and two colours whose bits differ are two
colours -- feeding the same `group_in_first_appearance_order` that
Phase 3 groups shapes with. The colour policy moved out of the two draw
loops into `constants::part_outline_color`, so the renderer and
`frame_budget` cannot disagree about how many groups a frame has; the 2D
loop had `vec4(1.0, 0.82, 0.40, 1.0)` written out where
`PART_SELECT_COLOR` already existed.

**Selected and hovered parts stroke last**, in their own groups, so a
highlight is never hidden under a neighbour's outline. They were
interleaved in document order before and could be.

`FrameBudget` gained `grid_lines` and `part_outlines` beside the call
counts. Geometry volume and call count are different numbers now and
both are worth reading -- `VectorSubmission { outlines, stroke_calls }`
mirrors Phase 3's `MeshSubmission` for the same reason.

Measured (bench_frame_submission_budget, 1920x1080, 200 m site):

  zoom   5 m, 2000 parts:   12 visible outlines ->  4 tessellations (was 2170)
  zoom 200 m, 2000 parts: 2000 visible outlines ->  4 tessellations (was 2270)

The second row is the point, and it is the row Phase 1 could not move:
everything is on screen, culling removes nothing, and the frame still
costs four calls.

WHAT THIS DOES NOT DO: vertex volume is unchanged. The same 2,000
rectangles are tessellated -- in two calls rather than 2,000. What is
saved is per-call overhead: tessellator setup, two `std::mem::take`s and
an `append_geometry` each time. If a 2,000-part plan view is still slow
after this, the remaining cost is triangles, which is Phase 5 and should
only happen if a measurement asks for it.

One visible-behaviour caveat, stated rather than buried: parts of the
same colour are now drawn together, so where two outlines of *different*
colours overlap, which is on top can change. They are 1.8 px outlines
and the highlight ordering got strictly better, but it is a change to
what is drawn, not only to how.

Two tests were wrong before the code was, which is becoming this plan's
pattern. `constants.rs` fell to 81.82% and the coverage floor caught it
-- `part_outline_color` had no tests, and it now has five. And the guard
test's first draft looked for a closing brace at a fixed indentation,
matched the wrong one, and failed on correct code; it matches braces
properly now.

Verified: tools/test-cad-coverage.sh green -- total 97.33%, batching.rs
100%, cull.rs 100%, render_budget.rs 99.68%, constants.rs 98.55%, all
floors met; cargo check --locked -p nigig-build --lib clean; cargo test
--lib 1114 passed (1100 + 14 new); --test cad_integration 154 passed;
CAD_BENCH=1 harness green; cargo fmt --check and git diff --check clean.
2026-08-21 05:08:14 +00:00
087965f17d docs(pdf): does the PDF viewport have a minimal-drawcall strategy? No -- and the renderer is unwired
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
The same question CAD_DRAWCALL_STRATEGY_ANALYSIS.md asked of the CAD
viewport, asked of pdf-makepad, and prompted by the same datagrid brief:
"virtual viewport on both axes" and "an optimal minimal drawcall
strategy". Those are two techniques, and PDF has a partial version of the
first and none of the second.

The finding that precedes every other one: `PdfRenderer` is exported from
lib.rs and referenced by nothing in the widget's draw path. grep returns
the `pub use` and nothing else. `PdfPageWidget::draw_walk` draws a
background, then a placeholder or link/field affordances -- it never
constructs a renderer and never replays a RenderCommand. Page content
costs zero draw calls because page content is not drawn. That also
explains the `#[allow(dead_code)]` on ClipRect "retained for the
scissor-rect work in Phase 7": clipping is modelled but unreachable.

So the numbers below are projections of what happens the moment the
renderer is wired in, which is exactly when a strategy stops being
theoretical. They are stated as projections in the document.

Makepad's batching model was read from source rather than inferred,
because the CAD note records getting precisely this wrong in its own
first draft (its section 0.1). In draw_vector.rs at the pinned rev,
`cx.new_draw_call` appears exactly twice, both inside `end()`. `begin()`
clears accumulation buffers; `stroke()` and `fill()` tessellate and issue
no draw call. An unbounded number of paints therefore cost one draw call
provided nothing calls `end()` between them.

renderer.rs calls `end()` from `finish_path()`, and `finish_path()` runs
on Save, Restore, PushClip, PopClip and the two Clip ops. Save/Restore
are `q`/`Q`: graphics-state operations, not clip operations, and very
frequent in real files.

Measured by replaying the corpus through that exact state machine --
tools/analysis/pdf_drawcall_census.rs, so the numbers can be reproduced
instead of trusted. 165 pages, 15,185 commands, 3,911 draw calls, 23.7
per page. Of the 2,578 vector draw calls, 2,460 are caused by q/Q and
**two** by clipping. The renderer flushes on the operation that does not
need a flush, and the operation that does need one barely occurs. Colour,
stroke width and the CTM are all baked into vertices on the CPU before
tessellation, so a state change needs no draw-call boundary; only a clip
does, being a GPU scissor concern.

Flushing only on clip change takes the vector side from 2,578 to 166 --
about one per page, 15.5x. The blended figure is a more modest 2.6x and
the document leads with that rather than the flattering one, because text
then dominates: DrawText exposes begin_many_instances, renderer.rs uses
neither it nor begin_deferred_slug_flush, so every run is its own batch,
and the renderer alternates between three DrawText objects which breaks a
batch even when the API is used.

On virtual viewports PDF is genuinely ahead of CAD, and the document says
so: cache.rs is a real LRU with a byte budget rather than an entry count,
generation-tagged, and phase7_exit_criterion.rs asserts the behaviours by
name. That is a tested virtual viewport on the page axis. There is none
within a page -- draw_affordances loops every annotation filtering only
by page index and visibility, never against the viewport rect it already
holds, and nothing skips an offscreen command.

The asymmetry worth recording for anyone porting the datagrid approach: a
grid's virtual viewport is cheap because cell geometry is derivable by
division. A PDF's is expensive because geometry is accumulated through a
stateful CTM, so a command's screen rect is unknowable without
interpreting everything before it. The bbox index is the price of entry
and belongs in RecordingDevice, which already tracks the CTM.

What is not measured is stated plainly: no GPU profiling, no frame times,
because the ui.rs suite that would host a benchmark is still #[ignore]d
on the missing Makepad headless backend. Draw calls are a proxy for cost,
not cost. 24 per page is not alarming on a desktop GPU; the argument is
that the count scales with document complexity rather than viewport size.

No source was changed. The suggested order puts "stop flushing on q/Q"
first because it is a deletion, and puts wiring the renderer third so the
strategy lands with the feature instead of after it.
2026-08-21 05:04:41 +00:00
06a3de6126 feat(spreadsheet): dropdown cells and button cells (#9 remainder, complete)
Some checks failed
repo hygiene / hygiene (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
Finish the widget-in-cell catalog with the two deferred controls, each a
plain value plus a render flag (same convention as checkbox/slider/Markdown).

- Dropdown: CellStyle.choices (a serialized, pipe-escaped list) makes a
  cell cycle through its choices on click. The toolbar "Drop" button parses
  the selected cell's value as a "Low|Med|High" list into choices (undoable
  SetChoices) and selects the first entry; a dropdown renders its value
  with a trailing ▾ affordance. dropdown.rs holds next_choice /
  parse_choice_list.
- Button: CellStyle.button makes a cell a button whose value is a
  TARGET[+N] action spec (A1 ref + optional signed step, default +1).
  Clicking increments the target cell's numeric value through set_cell
  (undoable, recalculates dependents) — the spreadsheet-native counterpart
  of the reference's "+10" boost. button.rs holds parse_button_spec /
  button_step / format_step_value; the cell renders as a raised box with
  the spec centred. Toolbar "Btn" toggles the flag.

Both flags ride in the render cache so cached cells stay styled, and both
commands route through WorkbookCommand (apply + apply_command + dirty
marking). Choices serialize after the markdown/slider/button flags; older
files default to off/empty.

Engine: 491 lib tests (+4) + integration. UI controllers: 142 tests (+8,
button 5 + dropdown 4). Coverage: engine 96.59%, ui-controllers 99.45%
(floors 96); button.rs and dropdown.rs at 100%.
2026-08-21 04:52:00 +00:00
328690dfbf feat(spreadsheet): 3-state header sort (asc/desc/off) with a timed report
Close the last sort gap: the spreadsheet grid's header sort now cycles
ascending → descending → off like the datagrid reference, and reports how
long each sort took.

Engine: SpreadsheetData::sort_rows remembers a RowSort { ascending,
key_col, restore } where restore[view_row] is the row the data originally
lived on, composed across sort chains. New unsort_rows applies that map to
restore the pre-sort order (no-op without a sort, clears undo, recalculates
moved formulas); sort_state() reports the active (column, direction).
Workbook gains unsort_active_sheet and active_sort_state. The sort order is
transient — reset by deserialize, never serialized.

UI: sort_state::next_sort_state replaces the 2-state next_sort_direction
with the asc→desc→off cycle, and the workspace HeaderClicked handler times
the sort with std::time::Instant, drives unsort_active_sheet on "off", and
appends the report ("sorted 1000 rows by B descending in N ms") to the
status bar via a cached sort_status field.

Engine: 487 lib tests (+6) + integration. UI controllers: 134 tests.
Coverage: engine 96.66%, ui-controllers 99.42% (floors 96).
2026-08-21 04:52:00 +00:00
dc1defd7e8 perf(cad): one draw call per shape, not per part -- Phase 3 of the render plan
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
A 2,000-part model of six repeated shapes now draws in six calls. It
drew in 2,000 before, and in 733 after Phase 1 culling at a working
camera distance -- but at 400 m, with the whole site on screen and
nothing to cull, it still drew in 2,000. Culling decides which parts are
submitted; instancing decides how many calls carry them. They are
different axes and this is the one that does not care where the camera
is.

No shader change was needed and that was the surprise of the phase.
`DrawCadMesh`'s `transform`, `color`, `depth_clip` and `display_mode`
are `#[live]` fields after `#[deref] draw_vars` in a `#[repr(C)]` struct,
which is precisely the per-instance row `DrawVars::as_slice` packs and
sends. The loop was already sending instance rows -- one per call. Three
methods (`begin_instances`, `push_instance`, `end_instances`), ported
from `DrawPbr::begin_many_instances_for_mesh` in the pinned fork, keep
the call open across a group instead.

New `batching.rs` (pure, 100% covered, floored):

    group_in_first_appearance_order(items) -> Vec<(K, Vec<T>)>
    batch_count(keys)                      -> usize

First-appearance order rather than iterating a `HashMap`, deliberately.
`HashMap` order is randomised per process, so batch order -- and the
order parts reach the GPU -- would differ between runs and after a
rehash. For opaque depth-tested geometry that is invisible, which is
exactly what makes it a bad thing to depend on: the day someone adds a
translucent material it becomes a flicker that reproduces on one machine
in five.

`FrameBudget` now carries `MeshSubmission { instances, batches }`. Named
fields rather than a second positional `usize` because the entire point
of the phase is that the two numbers now differ, and a caller that
swapped them would report the win backwards.

Measured (`bench_frame_submission_budget`, counts):

  camera  20 m, 2000 parts:  733 visible ->    6 draw calls (was 2000)
  camera  80 m, 2000 parts: 1459 visible ->    6 draw calls (was 2000)
  camera 400 m, 2000 parts: 2000 visible ->    6 draw calls (was 2000)
  ...and with every part a different size, 733/1459/2000 -- the ceiling,
  which is in the table for the same reason Phase 2's is.

WHAT IS NOT VERIFIED, plainly. The instanced submission has never run.
There is no GPU, no window and no `Cx` here, and tests/ui.rs still fails
at child-build exit 101. What is verified: it compiles against the real
Makepad API; the grouping is right (seven tests, including "no item is
lost or duplicated", which is the failure mode hardest to see in a
screenshot); the budget arithmetic is right; and the batch cannot be
left open on any path -- `every_instanced_batch_is_closed_before_the_loop_turns`
is a source check in the same style as the redraw_all guard, because a
batch left open drops its rows and the parts simply vanish with no error
anywhere.

Someone with a window needs to open a 3D model and confirm the picture
is unchanged. Two things limit the damage if it is not: `begin_instances`
returning false falls back to the old one-call-per-part loop (it returns
false while the draw shader is still compiling, which happens on the
first frames of every window), and batch order is deterministic, so a
defect reproduces instead of flickering.

Verified: tools/test-cad-coverage.sh green -- batching.rs 100%, cull.rs
100%, total 97.30%, all floors met; cargo check --locked -p nigig-build
--lib clean at the 127-warning baseline; cargo test --lib 1100 passed
(1091 + 9 new); --test cad_integration 154 passed; CAD_BENCH=1 harness
green; cargo fmt --check and git diff --check clean.
2026-08-21 04:41:48 +00:00
1e5d014198 perf(cad): one GPU buffer per shape, not per part -- Phase 2 of the render plan
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
Two hundred identical columns held two hundred GPU vertex buffers. They
build byte-identical triangles -- `CadSolid::build_mesh` is a pure
function of the solid payload and returns local-space geometry, and the
upload path (`part_mesh_buffers_from_mesh` -> `MeshSpace::Model`) carries
no transform and no colour -- so the duplication bought nothing but
memory and upload time.

`part_geoms` is now `HashMap<ShapeHash, Geometry>`.

**ShapeHash**, new in cad_scene.rs: the solid payload and nothing else.
No node id, no transform, no material. `ParamHash` is now *defined in
terms of it* -- `id` then `ShapeHash` -- rather than repeating the match
arm by arm. That is deliberate: last commit corrected a plan written on
the assumption that equal `ParamHash` meant "same shape", which the
leading `node.id.hash()` quietly made false. With one shared body the
two hashes cannot drift apart again, and `param_hash_moves_whenever_the_shape_hash_moves`
pins the join.

Three consequences worth naming:

- **Staleness became structural.** The key IS the content hash, so the
  draw loop's `.filter(|(hash, _)| *hash == ParamHash::from_node(part))`
  is gone: an edited part looks up a key that does not exist yet and
  `ensure_part_geometry` uploads it on the same frame. There is no
  "entry uploaded from different parameters" state left to guard
  against, which is the class of bug `subdivide_selected` shipped.
- **Eviction is by live shape, not live id.** This is the hazard the
  change introduces and it is not obvious: deleting one of two hundred
  identical columns must NOT drop the buffer the other 199 draw from. An
  eviction written as "remove the deleted node's entry" would blank most
  of the model. `geometry_is_retained_by_live_shape_not_by_live_id`
  pins it.
- **Uploads deduplicate within the frame.** Without the `queued` set,
  the first frame of a 200-column scene would call `get_or_build` two
  hundred times before the map had anything in it.

Measured (`bench_geometry_buffers_shared_by_shape`, counts not timings):

  200 identical walls          200 parts ->   1 buffer   (200x)
  420-part repetitive model    420 parts ->   6 buffers   (70x)
  420 all-distinct parts       420 parts -> 420 buffers    (1x)

The last row is in the table on purpose. Sharing is a property of the
model, not of the code; a scene where every part differs gets nothing
from this phase. And draw calls are unchanged -- still one per visible
part -- exactly as the plan predicted. Collapsing those is Phase 3,
which needed these shared buffers to be possible at all.

Estimated at a week, took under a day. Two things the estimate did not
know: `MeshCache::get_or_build` was already a pure function of
`node.solid`, and the upload path already produced transform-free,
colour-free buffers. It assumed both would need untangling; they were
built right the first time.

Verified: tools/test-cad-coverage.sh green -- total 97.27%, cad_scene.rs
98.56%, cull.rs 100%, all floors met; cargo check --locked -p nigig-build
--lib clean (and one warning fewer: the `ParamHash` re-export in mod.rs
is no longer needed by the widget layer); cargo test --lib 1091 passed
(1085 + 6 new); --test cad_integration 154 passed; CAD_BENCH=1 harness
green; cargo fmt --check and git diff --check clean.
2026-08-21 04:18:33 +00:00
4aaebafe4e perf(cad): cull parts against the viewport -- Phase 1 of the render plan
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
Before this, `grep -niE "cull|frustum|offscreen|in_view"` over the 2,438
line renderer returned nothing. Every part in the document was
tessellated in 2D and issued its own draw call in 3D, on screen or not.
At a 5 m drafting zoom over a 200 m site, a 2,000-part model spent 2,000
tessellations and 2,001 draw calls per frame to show twelve parts.

New `cull.rs` -- pure, host-testable, 100% covered with a floor in
tools/test-cad-coverage.sh:

    draw_part_2d(centre, half_w, half_h, view, decorated) -> bool
    Frustum::from_view_projection(view, projection)       -> Frustum
    Frustum::draw_part_3d(aabb, decorated)                -> bool
    world_aabb_from_local_bounds(min, max, model)         -> WorldAabb

It lives in its own module for the same reason nav_pad.rs and
render_budget.rs do: viewport_render.rs is 2,438 lines at 0.00% coverage
and needs a Cx, so a predicate written inline there could not be tested
at all. Both draw loops AND CadViewport::frame_budget call these same
functions, which is what stops the reported budget from drifting away
from what is drawn -- the discipline render_budget.rs already applies to
the grid loops.

Measured (bench_frame_submission_budget, 1920x1080, parts on a 200 m
site; full tables in BENCH_BASELINE.md):

  2D, 5 m zoom, 2,000 parts:  12 visible.  2,170 -> 182 tessellations,
                              2,001 -> 13 draw calls.
  3D, 20 m camera, 2,000:     733 draw calls, 63% culled.
  3D, 80 m camera, 2,000:     1,459 draw calls, 27% culled.
  Whole site on screen:       nothing culled, and nothing should be.

That last row is the honest half and it is in the doc too: when the view
holds the whole model, all 2,000 parts are genuinely visible and culling
cannot help. Phases 2 and 3 (shape-shared geometry, then instancing) are
what address that case.

Three things came out different from the plan I wrote last commit, and
the plan was wrong about each:

- **AABB, not bounding sphere.** A sphere around an AABB is looser at
  the same cost -- a 6 m wall gets a 3 m radius ball. The p-vertex
  AABB-versus-plane test is strictly tighter. So there is no
  bounding_sphere helper, and in particular no bounding_sphere FIELD on
  CadNode: the AABB is already cached by PlacedHash in SceneCache, which
  invalidates itself on a move or a resize, where a stored field would
  have to be maintained at 77 construction sites.
- **world_aabb_from_local_bounds is shared with pick_part**, replacing
  the eight-corner transform that was inline there. Two copies would be
  two chances to disagree about a part's bounds, and picking a part the
  renderer culled is precisely the bug that disagreement produces.
- **The "drawn extent" hazard split into two concrete rules.** The 2D
  test takes part_to_plane_2d and part_size_on_plane -- the very values
  the draw uses -- so it tests the drawn rect, not the model extent. And
  no selected or hovered part is ever culled: the highlight and the
  tooltip are drawn at the cursor, arbitrarily far from the part.

The frustum comes from Gribb-Hartmann row arithmetic on
projection * view, deliberately not from mat4_inverse -- that function
had a mistyped index in all sixteen cofactors until 2ea5a74, and the
terms that were wrong are exactly the ones a perspective matrix makes
non-zero. Makepad's Mat4f::perspective is the OpenGL convention
(xr/src/scene/xr_root.rs builds the camera with it), so -w <= x,y,z <= w
is right; a 0..w depth projection would only make the near plane more
permissive, which is the safe direction.

Both predicates are conservative by construction: NaN coordinates, NaN
AABBs, negative extents and an identity camera all fall through to
"draw it". A part kept but invisible costs one submission; a part culled
but visible is a bug the user sees.

One test of mine was wrong before the code was: the first draft asserted
a part 40 m off axis was invisible from a 50 m camera at 60 deg on 16:9.
tan(30 deg) * 16/9 is 1.03, so the horizontal half-angle reaches past
45 deg and the part is on screen. The frustum was right; the test is now
narrow-fov and says so in its docstring.

Verified: tools/test-cad-coverage.sh green -- cull.rs 100.00%, total
97.26% (was 97.20%), all floors met; cargo check --locked -p nigig-build
--lib clean; cargo test --locked -p nigig-build --lib 1085 passed
(1062 + 23 new); --test cad_integration 154 passed; cargo fmt --check
clean; git diff --check clean.

Not done here: the two hard-coded 1.2 margins in viewport_render.rs
(397-400, 1374-1377) still do not read render_budget::VIEW_MARGIN. cull.rs
does, so cull and grid agree by the constant rather than by the code.
Folded into Phase 4, which rewrites those loops anyway.
2026-08-20 21:45:45 +00:00