repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nuguland: nested system and arch revam spec

337ae921a21c4b93da5d08e6aa7f48e06ab259bd

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

Changed files (94)

.system/MISSION.md

Modified
1 1 # MISSION
3 -Enduring high-level project objective and why it matters.
4 -Update only when the end goal changes; current operating priorities belong in a phase.
3 +Every machine I touch becomes mine after one clone: encrypted secrets, hostname manifests, one command to check.

.system/RULES.md

Modified
1 1 # RULES
3 -Concrete operating constraints: commands, safety, style, boundaries, and do/don't rules.
4 -Keep executable; avoid goals and rationale unless needed.
3 +## Standards
5 +Zero warnings, isolated evidence, reviewed output. Rigor over velocity claims.
7 +## Repository
9 +- Run repo commands from the dotfiles root; nested project commands run from their project root.
10 +- Check `git status --short` before edits; preserve unrelated dirty work.
11 +- Never run privileged, root, or elevated commands.
12 +- Do not delete noisy research, cache, or untracked files unless explicitly asked.
13 +- Prefer repo paths (`pi/agent/...`) over `$HOME` paths.
15 +## Secrets
17 +- `.secrets` is plaintext and lists repo-relative paths to encrypt; the `dotfiles-aes` Git filter does the encryption.
18 +- New secret flow:
19 + 1. edit `.secrets`
20 + 2. `java bootstripper.java check`
21 + 3. `git add .secrets .gitattributes`
22 + 4. `git check-attr -a -- path/to/secret`
23 +- Required attrs: `filter: dotfiles-aes`, `text: unset`, `diff: unset`.
24 +- A `.secrets` path must not match any ignore rule; `check` fails otherwise because `git add -A` would silently skip it.
25 +- Never `git add -A` new secret-looking files before that flow.
26 +- Private keys must not be staged as plaintext: `git cat-file -p :path/to/key | LC_ALL=C grep -q 'BEGIN .*PRIVATE KEY' && exit 1`.
27 +- Never print decrypted secrets; never ask for or expose `DOTFILES_AES_PASSPHRASE` unless I explicitly initiate setup.
28 +- Secret paths include `ssh/*.key`, `gh/hosts.yml`, `pi/agent/auth.json`, `nushell/secrets.nu`, app private settings.
30 +## Git
32 +- `rebase.autostash` and `merge.autostash` stay `false`; `mise run check` asserts it. Dirty worktree: commit first, or stash explicitly and pop it yourself.
33 +- The `dotfiles-aes` filter and `pre-commit`/`pre-push` hooks can abort Git midway; never pass `--no-verify`.
34 +- Commits and pushes require `gitleaks` on Git's `PATH`; missing Gitleaks blocks the Git operation, not the worktree.
36 +## Symlinks
38 +- Manifest pairs stay ordered and complete; blank line between pairs.
39 +- Managed symlinks never point outside HOME; no `/usr`, no `/etc`. Outside-HOME symlinks are errors: do not relink or delete them.
41 +## Repo commands
43 +Safe checks: `mise run check`, `mise run secrets-scan`.
44 +Heavy integration: `mise run ci` (needs host Podman).
45 +Crypto and hooks: `java bootstripper.java check | pre-commit | pre-push | install-hooks | init-crypto | setup-crypto`.
46 +HOME-mutating, only on explicit request: `mise run link`, `mise run clean`.
47 +`link` validates manifests, converges crypto idempotently, installs or repairs hooks, and creates symlinks; restoration refuses staged changes, deletions, symlinks, changed ciphertext, or mixed states.
49 +## Nested Systems
51 +- `quickshell/nuguland/.system/` governs the shell; its law applies there, not here.
52 +- Do not duplicate nested law in this System.
54 +## Docs
56 +- `.system/` cores and specs are agent authority; read RULES and the relevant spec before governed work.
57 +- READMEs are human overview; agent-only knowledge belongs in `.system/`.

.system/SYSTEM.md

Modified
1 1 # SYSTEM
3 -Stable project identity, domain truths, architecture invariants, and non-negotiable conventions.
4 -Keep durable; do not put current tasks here.
3 +## Repo
5 +Dorkfiles. One Git repository, several machines.
6 +Host bootstrap assumes Git and mise; mise supplies Java; other tools come from the system package manager.
7 +`bootstripper.java` converges the Git filter, attributes, and hooks that keep secrets encrypted and commits gated.
9 +Symlink manifests are `repo/path` + `~/target/path` pairs; the hostname chooses `<host>.symlinks`.
11 +Nested Systems, each governing its own subtree:
13 +- `quickshell/nuguland/` — desktop shell, own System with `NL` IDs.
14 +- `neovim/` — own subtree; not yet initialized.
16 +Also in this repo:
18 +- `pi/agent/` — Pi settings, models, modes, skills; extension sources under `pi-ext/extensions/`.
19 +- Nugu palettes and themes — load the `nugu` skill before palette work.
21 +## Docs hierarchy
23 +This System and RULES are repo authority below nested Systems.
24 +READMEs are human overview and carry no binding rules.

.system/config.json

Modified
2 - "prefix": "NL",
2 + "prefix": "DORK",
3 3 "schemaVersion": 0,
4 4 "title": "dotfiles"

.system/plans/NL-PLAN-0AC08B83-brightness-popup-initial-redesign/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-0AC08B83
3 -type: plan
4 -title: Brightness popup initial redesign
5 -spec: NL-SPEC-FDA339B0
6 -status: approved
7 ----
9 -# Brightness popup initial redesign
11 -This plan covers the approved initial redesign only.
12 -The later transactional DDC contract remains unplanned.
14 -1. Extend pure brightness shaping and tests for real display rows, controllability, and global none, synced, and mixed state.
15 -2. Extend the brightness service with live output state, display and global state, and an explicit user-triggered setup action.
16 -3. Replace the panel with setup-only behavior when unavailable, global and preset controls when available, and independent display rows.
17 -4. Route global, preset, and per-display interactions through the service interfaces.
18 -5. Run targeted brightness tests, formatting, the zero-warning lint gate, and accepted-mockup visual review.
20 -Exit when real-display behavior works without fake controls and all listed checks pass.

.system/plans/NL-PLAN-0D15DD3E-nuguland-orientation-rollout/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-0D15DD3E
3 -type: plan
4 -title: Nuguland orientation rollout
5 -spec: NL-SPEC-0B9CBD34
6 -status: approved
7 ----
9 -# Nuguland orientation rollout
11 -1. **Orientation interface**
12 - Add one shell-owned orientation value, public set and toggle operations, geometry reads, and the compositor binding.
13 - Preserve existing IPC JSON fields.
14 -2. **Compact formatting**
15 - Centralize the abbreviation rule and expose its pure self-test.
16 - Exit when all required cases pass.
17 -3. **Bar layout**
18 - Thread orientation through the bar, switch anchors and flow, derive vertical thickness from content, compact vertical workspace labels, and render the stacked clock without overlap.
19 - Exit when registered geometry proves both layouts.
20 -4. **Popout geometry**
21 - Thread orientation and bar thickness through placement and outside-dismiss handling.
22 - Exit when both orientations open, clamp, and dismiss correctly.
23 -5. **Review**
24 - Verify live toggling, clean logs, geometry reads, horizontal regression behavior, and visual legibility.

.system/plans/NL-PLAN-0E85CD00-deliver-read-only-caldav-calendar/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-0E85CD00
3 -type: plan
4 -title: Deliver read-only CalDAV calendar
5 -spec: NL-SPEC-9D4A99C2
6 -status: approved
7 ----
9 -# Deliver read-only CalDAV calendar
11 -1. **Parsing and layout core**
12 - Provide runtime-neutral calendar parsing and multi-day segmentation.
13 - Test unfolding, decoding, dates, tasks, malformed input, week wrapping, and lane allocation.
14 -2. **Calendar service interface**
15 - Own non-secret configuration, status, events, calendars, refresh, setup, self-test, and additive state behind one injected service.
16 -3. **Discovery and fetch**
17 - Discover event and task calendars with read-only DAV requests.
18 - Expand events server-side, leave VTODO unexpanded, and filter dated tasks to the visible window.
19 - Keep credentials outside arguments, logs, responses, and persistent configuration.
20 -4. **Lifecycle integration**
21 - Inject the service through the shell and expose state and refresh IPC.
22 - Refresh after configuration load, every 15 minutes, and when the clock popup opens.
23 -5. **Month grid**
24 - Render the Monday-first 42-day grid with lowercase weekdays, today and spillover treatment, dots, pills, and calendar colors.
25 -6. **Multi-day bands**
26 - Render week-split segments with reserved lanes and verify deterministic week wrapping.
27 -7. **Agenda and stale state**
28 - Order today's all-day items and tasks before timed events.
29 - Support scrolling, empty state, last-good data, and stale indication.
30 -8. **Setup and keyring handoff**
31 - Add lowercase URL, username, app-password, and save controls with explicit app-password guidance.
32 - Validate fields, store through the keyring boundary, clear transient secret state, and show inline failures safely.
33 -9. **Verification**
34 - Run parser and service checks.
35 - Validate startup, additive IPC, live discovery and fetch, offline behavior, keyring failure, credential non-disclosure, and required screenshots.

.system/plans/NL-PLAN-2CA16D60-nuguland-companion-shell-rollout/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-2CA16D60
3 -type: plan
4 -title: Nuguland companion shell rollout
5 -spec: NL-SPEC-86A037A0
6 -status: approved
7 ----
9 -# Nuguland companion shell rollout
11 -1. **Foundation**
12 - Establish the named shell, composition-root service injection, Nugu semantics, public IPC, diagnostics, and graphical-session service.
13 - Keep incumbent frontends authoritative until live checks pass.
14 -2. **Bar core**
15 - Add the primary-output bar, all-output workspace state, workspace actions, and clock.
16 - Exit when geometry, updates, and safe show or hide checks pass.
17 -3. **Status services**
18 - Add media, connectivity, resources, audio, brightness, and battery state through native services or bounded adapters.
19 - Exit when values match independent system readings and every interaction is verified.
20 -4. **Companion surfaces**
21 - Add tray, clipboard, bind-mode state, calendar, idle inhibition, and confirmed power interactions.
22 - Exit when popouts are readable, keyboard accessible, and destructive paths remain gated.
23 -5. **Native notifications**
24 - Transfer notification ownership under a rollback guard.
25 - Verify urgency, timeout, actions, history, dismissal, and do-not-disturb behavior.
26 - Exit when one daemon owns the bus and rollback is proven.
27 -6. **Cutover**
28 - Run parse, lint, interaction, visual, service, and process checks.
29 - Remove live references to replaced frontends only after parity evidence and human approval.

.system/plans/NL-PLAN-5E808493-deliver-notification-surfaces-and-lifecycle/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-5E808493
3 -type: plan
4 -title: Deliver notification surfaces and lifecycle
5 -spec: NL-SPEC-C49F734E
6 -status: approved
7 ----
9 -# Deliver notification surfaces and lifecycle
11 -1. **Notification identity**
12 - Introduce ID-keyed replacement preserving read state and row order.
13 - Cover it through the service self-test.
14 -2. **Toast lifecycle**
15 - Track active toast snapshots separately from history.
16 - Define eligibility, expiry, transient handling, critical behavior, reference cleanup, and dismissal.
17 - Expose active toasts additively through state and IPC.
18 -3. **Shared card**
19 - Provide full and compact modes with icon resolution, images, dismissal, actions, and advertised reply.
20 -4. **Popup surface**
21 - Render grouped, scrollable full cards with lowercase notification controls.
22 - Remove debug labels, drag handling, and masked action rails.
23 -5. **Toast surface**
24 - Render compact cards in a non-focus-stealing primary-screen overlay.
25 - Preserve independent lifetimes across model rebuilds and sticky critical behavior.
26 -6. **Compositor route**
27 - Bind the reserved shortcut to toast dismissal and verify the IPC target end to end.
28 -7. **Service cleanup**
29 - Remove drag IPC and telemetry only after proving no live consumers remain.
30 -8. **Verification**
31 - Run isolated and real-notification checks covering replacement, transient handling, expiry, DND, critical persistence, actions, images, scrolling, and shortcuts.
32 - Verify both card modes and inspect logs after cache-clean restarts.

.system/plans/NL-PLAN-7AB0F679-nugu-desktop-theme-rollout/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-7AB0F679
3 -type: plan
4 -title: Nugu desktop theme rollout
5 -spec: NL-SPEC-83056D8D
6 -status: approved
7 ----
9 -# Nugu desktop theme rollout
11 -1. **Generator boundary**
12 - Produce deterministic dark and light color-only artifacts from the Nugu palette.
13 - Exit when generation and palette validation pass for both modes.
14 -2. **Runtime state and command boundary**
15 - Provide mode selection, toggle, current-mode preparation, and read-only status against XDG state.
16 - Exit when invalid-state fallback and side effects match the spec.
17 -3. **Consumer adapters**
18 - Connect desktop preference, compositor, Nuguland, and enabled mode-aware consumers without moving layout or behavior into runtime theme state.
19 - Exit when every enabled consumer updates safely.
20 -4. **Startup integration**
21 - Materialize required runtime artifacts before consumers start without mutating tracked configuration.
22 - Exit when service and cold-start checks pass.
23 -5. **Contract verification**
24 - Run generator checks, both transitions, desktop-preference assertions, repository-diff invariance, and human visual review.
25 - Exit only when the full round trip passes without a tracked change.

.system/plans/NL-PLAN-C19E2C04-power-popup-two-zone-redesign/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-C19E2C04
3 -type: plan
4 -title: Power popup two-zone redesign
5 -spec: NL-SPEC-C24FF4FA
6 -status: approved
7 ----
9 -# Power popup two-zone redesign
11 -1. Add tested battery-presence shaping distinguishing desktop placeholders from real main batteries.
12 -2. Expose battery presence without changing session routing or confirmation behavior.
13 -3. Replace the equal-weight panel with an optional battery hero, external-device chips, the complete safe-action group, and a separate danger region.
14 -4. Replace the danger region with in-place confirm and cancel controls while a destructive action is pending.
15 -5. Preserve Enter-to-confirm and Escape-to-cancel behavior.
16 -6. Run power shaping tests, formatting, the zero-warning lint gate, and visual checks for battery-present and battery-absent states.
18 -Exit when desktops show no fake battery, every safe action remains available, destructive actions remain gated, and the two-zone layout is verified.

.system/plans/NL-PLAN-F85F4593-deliver-event-driven-audio-state/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-F85F4593
3 -type: plan
4 -title: Deliver event-driven audio state
5 -spec: NL-SPEC-FEE98E07
6 -status: approved
7 ----
9 -# Deliver event-driven audio state
11 -1. **Media contract**
12 - Derive media energy only from playback state.
13 - Remove state descriptions claiming waveform or peak-history input.
14 -2. **Audio service**
15 - Remove peak-monitor ownership, level properties, smoothing state, and periodic smoothing.
16 - Preserve PipeWire tracking, controls, stream rows, and privacy state.
17 - Derive activity from active links and mute state.
18 -3. **State interfaces**
19 - Remove deleted amplitude concepts while preserving unrelated audio, media, privacy, and IPC behavior.
20 -4. **Static verification**
21 - Confirm no stale peak-monitor, level, smoothing, or amplitude references remain.
22 - Run audio service checks.
23 -5. **Runtime verification**
24 - Restart with a clean QML cache and inspect logs and IPC.
25 - Exercise volume, mute, device selection, and microphone privacy.
26 -6. **Resource verification**
27 - Confirm no shell-owned peak stream exists, the idle sink can suspend, and idle CPU improves against the recorded baseline.

.system/specs/NL-SPEC-0B9CBD34-nuguland-bar-orientation/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-0B9CBD34
3 -type: spec
4 -title: Nuguland bar orientation
5 ----
7 -# Nuguland bar orientation
9 -## Behavior
11 -- The bar has one global orientation: `horizontal` or `vertical`.
12 -- The default is `horizontal`.
13 -- The orientation interface accepts either orientation or `toggle` and returns the resulting orientation.
14 -- Unknown input is a no-op returning the current orientation.
15 -- Changes apply live and remain consistent across bar and popout geometry.
17 -## Layout
19 -| Concern | Horizontal | Vertical |
20 -| --- | --- | --- |
21 -| Edge | top | left |
22 -| Span | full width | full height |
23 -| Thickness | fixed bar height | widest visible compact content |
24 -| Flow | left to right | top to bottom |
25 -| Clock | inline hour and minute | stacked hour, rule, minute |
26 -| Popouts | below the bar | right of the bar |
28 -- The clock remains the middle zone and never overlaps another bar zone.
29 -- Vertical workspace pills remain compact and use the widget-label abbreviation rule.
30 -- OSD and toast placement remains independently top-right.
31 -- Orientation transitions are immediate.
33 -## Abbreviation contract
35 -Drop `a`, `e`, `i`, `o`, and `u`, then take the first three characters.
36 -If fewer than three characters remain, take the first three characters of the original label.
38 -| Input | Output |
39 -| --- | --- |
40 -| `notify` | `ntf` |
41 -| `code` | `cod` |
42 -| `media` | `med` |
43 -| `system` | `sys` |
44 -| `audio` | `aud` |
45 -| `power` | `pwr` |
47 -## Popout constraints
49 -- Bar thickness is the only orientation-dependent offset shared with popout geometry.
50 -- Vertical popouts use the free area to the right, move rightward, and clamp on the y-axis.
51 -- Horizontal popouts use the free area below, move downward, and clamp on the x-axis.
52 -- The outside-dismiss region excludes the bar in both orientations.
54 -## Acceptance
56 -- Horizontal chips share a y-axis and vertical chips share an x-axis in increasing order.
57 -- Vertical thickness follows content rather than a fixed width.
58 -- The abbreviation self-test passes every required case.
59 -- Registered clock geometry does not overlap another bar zone.
60 -- Popout state reports the correct origin, constrained axis, and transition direction.
61 -- Outside dismissal does not intercept bar clicks.
62 -- Returning to horizontal preserves existing behavior.
63 -- The compositor keybind toggles orientation.
64 -- A human confirms labels, clock, and separator remain legible.

.system/specs/NL-SPEC-37DAB33A-system-popup/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-37DAB33A
3 -type: spec
4 -title: System popup
5 ----
7 -# System popup
9 -## Behavior
11 -- The popup shows machine identity and live resources, then the top five CPU consumers, followed by current issues and recent incidents.
12 -- Identity includes host, model, distribution, kernel, window manager, package count, shell, uptime, and battery facts when available.
13 -- Live statistics include CPU, memory, swap, temperature and fan when available, network, disk, and load.
14 -- Metrics use graphical fill bars and bounded sparklines rather than a terminal aesthetic.
15 -- Cheap metrics refresh about every two seconds.
16 -- Expensive disk, failed-service, and process checks run about every five seconds only while open.
17 -- Identity and update checks are cached and refreshed on open or infrequently.
18 -- Issues cover failed services, thermal state, low disk, memory with growing swap, battery health, updates, and load relative to core count.
19 -- Current conditions are severity-ordered under `needs attention`; recorded crashes and OOM kills are newest-first under `incident history`.
20 - History rows use neutral cards and subdued clock icons, never warning/error card emphasis, because a past event does not establish a current failure.
21 - Current failures retain their severity styling; history retains counts, times, open/`arrrgh` actions, and existing journal-window expiry.
22 - No acknowledgment/dismissal state is added and no journal entries or coredumps are deleted.
23 - Dispatch errors remain visibly actionable even on neutral history rows.
24 -- Repeated crashes with the same exact executable path and UID share one row, showing occurrence count and the latest crash time.
25 - Missing or lossy executable/UID identity leaves crashes separate; different applications/users and OOM events never merge.
26 - Groups are derived from retained journal records without dismissal state or additional persistence, and keep stable IDs as occurrences enter or leave the retained window.
27 - Groups are newest-first by their latest occurrence; the header counts records, not rows.
28 - The existing open action inspects the latest crash, while `arrrgh` receives every retained occurrence in the selected group, including exact boot/cursor/time and bounded metadata.
29 - Pending, error/retry, keyboard focus/reveal, and close-on-dispatch remain owned by the existing resource service and popup controls.
30 -- Incidents are limited to journal-visible records in the current boot and last 24 hours, up to the latest 100 matching records.
31 - Missing records do not imply that no application crashed; unavailable or incomplete history is explicit and retains last-good data.
32 -- Failed services, thermal conditions, disk/memory/load pressure, crashes, and OOM kills have an `arrrgh` button with the Nerd Font pirate icon and `assess and diagnose with pi` tooltip.
33 - Available updates and battery wear have no agent action, including at the dispatch boundary.
34 - Existing open actions remain available, including the update action.
35 -- App/service identity leads each row in emphasized text; issue type and metadata are secondary, with relative and local calendar times for incidents.
36 - Untrusted metadata is plain text, never markup.
37 -- `arrrgh` starts a fresh interactive Pi session in a new WezTerm window rooted at `$XDG_STATE_HOME/nuguland/repairs/`.
38 - Missing or relative `XDG_STATE_HOME` falls back to `~/.local/state`; the working directory stays stable across issues and sessions.
39 - Launch preflight creates the directory privately if absent, preserves existing contents and permissions, and refuses dispatch when it is unusable.
40 - The shared prompt lives in `quickshell/nuguland/prompts/system-repair.md`, not global agent configuration.
41 - Exactly one literal `{{context}}` slot receives JSON facts: issue identity/type/severity, observation time, machine identity, relevant measurements, service-manager scopes, and incident boot/time/cursor/process metadata.
42 - It contains no prescribed diagnostic commands, inferred cause, raw journal payloads, environment dumps, or core memory.
43 - The agent selects its own diagnostic tools.
44 - The template is read asynchronously on each launch; missing or malformed templates block dispatch with an error instead of reusing stale instructions.
45 - Each launch saves a private, uniquely named `.request-*.md` prompt snapshot in the repair directory and passes it to Pi as an `@file` argument.
46 - This preserves every retained occurrence even when the prompt exceeds Linux's per-argument size limit; write failures block dispatch with a visible retryable error.
47 - Request snapshots are repair evidence, never widget state, and earlier snapshots are not overwritten.
48 -- The prompt requires per-issue Markdown reports under `issues/` inside the stable repairs directory.
49 - Reports identify the exact issue and machine, and append dated attempts without replacing history.
50 - They contain the problem, evidence-backed root cause, attempted solutions and outcomes, verified fix, verification steps/results, learnings/prevention, blockers, and next steps.
51 - Only verified successful fixes are marked resolved; unsuccessful or partially verified attempts remain unresolved.
52 - Reports exclude secrets and raw sensitive logs; the agent verifies saving and reports the log path/status or save failure.
53 - Report writing is a prompt obligation, not an automatic resolution detector.
54 -- The shared instruction is to assess, diagnose, and recommend or apply an appropriate remedy, not to force a fix for every warning.
55 - Monitoring, no change, or a recommendation can be justified outcomes; an already-gone incident is not an invented successful repair.
56 -- Diagnosis comes first; privileged, destructive, package, service restart, and desktop-session changes require explicit human approval.
57 - This is a prompt constraint, not a new OS sandbox or permission mechanism.
58 -- Resource service owns dispatch state: pending disables duplicate launches, missing Pi/WezTerm leaves a visible error and retry, dispatch closes the popup to release keyboard focus.
59 - Dispatch means a launch request, not proof that Pi or its provider initialized successfully.
60 -- Pointer, Tab/Shift+Tab, Enter/Space, Escape, outside dismissal, and reopen retain the shared popup contract.
61 -- Empty current conditions and empty incident history have separate lowercase status rows.
63 -## Constraints
65 -- The popup remains smooth on the target ThinkPad X230.
66 -- Metric history is strictly bounded.
67 -- Closing the popup stops expensive probes.
68 -- Missing or failed data is shown as `n/a` or omitted and never creates a false issue.
69 -- Failed probes retain last-good data and do not crash the service.
70 -- Battery checks are skipped when no laptop battery exists.
71 -- Existing system-state IPC remains available with functional state only.
73 -## Issue thresholds
75 -- Failed services are errors.
76 -- Disk use at 90% is a warning and at 95% is an error.
77 -- Memory pressure requires at least 90% memory use and growing swap.
78 -- Battery health below 80% is a warning and below 60% is an error.
79 -- Thermal degradation is an error; crossing a sensor high threshold is at least a warning.
80 -- Available updates are informational.
82 -## Acceptance
84 -- Pure tests cover parsers, rate and ring behavior, formatting, thresholds, unavailable inputs, and action shaping.
85 -- Runtime self-test covers issue wiring and IPC shaping.
86 -- Nested-niri rendered screenshots and pointer/keyboard tests confirm identity and live cards, issue grouping, agent dispatch, failure/retry, long metadata, empty/unavailable history, and polling lifecycle.
87 -- Synthetic crash/OOM records and action-planner tests cover filtering, malformed data, stable identities, limits, service scopes, literal argv transport, and prompt safety.
89 -## Evidence
91 -[Agent actions and incident detection](evidence/arrrgh-2026-09-06/README.md).
92 -[Stable repair directory and issue reports](evidence/repair-log-2026-09-06/README.md).
93 -[Local repair prompt and eligible actions](evidence/repair-prompt-2026-09-06/README.md).
94 -[Repeated application crashes](evidence/crash-groups-2026-09-06/README.md).
95 -[Process line above issues](evidence/process-line-2026-09-06/README.md).
96 -[Neutral incident history](evidence/neutral-history-2026-09-06/README.md).

.system/specs/NL-SPEC-38AED50A-popup-interaction-language/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-38AED50A
3 -type: spec
4 -title: Nuguland popup interaction language
5 ----
7 -# Nuguland popup interaction language
9 -Follow-up: [UI/UX repair contract](ux-repair.md) and [repair progress with evidence](repair-progress.md).
11 -## Behavior
13 -- Every registered popup uses one common outer surface.
14 -- Matching UI roles use common sections, cards, buttons, toggles, separators, sliders, badges, and text fields.
15 -- Controls visibly distinguish hover, press, focus, selected or toggled, and disabled states.
16 -- Status is never communicated by color alone.
17 -- Cards provide large targets, visible status, and optional secondary detail.
18 -- Spacing and common regions provide grouping; dividers separate only unrelated groups.
19 -- All UI labels are lowercase.
20 -- Tray cards expose all nonempty documented metadata.
21 -- Tray left click activates, or opens the menu for menu-only items.
22 -- Tray right click opens an available native menu; middle click invokes secondary activation.
23 -- The launcher has no decorative bottom stripe.
24 -- Audio cards have no exposed left accent sliver.
26 -## Constraints
28 -- Service APIs remain stable except for specified notification and tray routes.
29 -- iwd remains the single Wi-Fi row and write authority.
30 -- No lockscreen, bar, palette, or dependency redesign is included.
31 -- Bespoke data visualization may remain bespoke.
32 -- Shared controls are keyboard accessible and expose appropriate accessibility roles and names.
34 -## Acceptance
36 -- DND, toast dismissal, Wi-Fi refresh and interaction, and all three tray pointer routes behave as specified.
37 -- Every registered popup uses the common surface and matching shared controls.
38 -- All popup labels are lowercase.
39 -- The full popup test suite and zero-warning lint gate pass.

.system/specs/NL-SPEC-38AED50A-popup-interaction-language/repair-progress.md

Deleted
deleted file mode 100644
1 -# UI/UX repair progress
3 -2026-09-06.
4 -Contract: [ux-repair.md](ux-repair.md).
5 -Evidence: [retained runs and visual review](evidence/ux-repair-2026-09-06/README.md).
7 -**The repair is not complete: DDC setup and the remaining acceptance gaps below are still open.**
8 -No features were deliberately removed.
9 -No parent desktop restart, real authentication, host network change, package installation, or new dependency was used.
10 -Unrelated dirty work remains untouched.
12 -## Implemented and exercised
14 -- Shared native-backed buttons, cards, sliders, fields, and styled tooltips provide pointer/keyboard activation, visible focus, disabled rejection, contextual names, bounded labels, and wrapped explanations.
15 - Nested controls cover exactly-once activation, thumb-grab stability, drag, external updates, and field-padding focus.
16 -- Hover no longer switches an active task.
17 - Explicit Bar activation switches panels; activating the same chip closes it.
18 - The vertical Bar accent remains a right-edge hairline rather than filling the Bar during orientation changes.
19 -- Shell-lifetime state retains clipboard and launcher queries/selections, panel disclosure, and scroll positions.
20 - Shared scroll restoration waits for rendered layout, not only Loader completion.
21 - Nested flows exercise close/reopen, switching, and orientation changes.
22 -- Clipboard commands preserve filtering and reactive updates.
23 - Pointer and keyboard paste close the real popup, verify native destination focus, and insert exactly once in a synthetic destination window.
24 - The focus-query Process exit signal is connected through `Connections`; a same-named method inside Process was inert.
25 -- Audio and brightness retain service bindings and stable interactive delegates.
26 - Nested flows cover live updates during audio drag, brightness updates after local pointer/keyboard changes, unavailable brightness controls, and keyboard scrolling through long audio lists.
27 -- Media capabilities disable unsupported controls.
28 - Tray primary, secondary, and menu routes are keyboard reachable.
29 - Power reboot/power-off confirmations cancel on switching and outside dismissal without executing destructive actions.
30 -- Connectivity preserves an expanded SSID and the same masked editor during live updates.
31 - Dismissal clears credential input while retaining ordinary disclosure state.
32 -- Notification replies are owned by service state.
33 - External updates and close/reopen preserve the draft; a failed send retains it with retryable feedback.
34 -- Noko capture start/stop supports pointer and keyboard.
35 - History copy reaches the native sandbox clipboard, keyboard traversal reveals focused rows, and reopening restores the actual history viewport.
36 -- Vault search supports keyboard selection reveal and clears stale detail on zero matches.
37 - Result selection and actual scroll position survive Loader recreation and orientation changes.
38 - Result/detail restoration is deferred until a rendered frame; checking retained service values alone missed a viewport reset.
39 -- Privilege prompts set initial focus without continually stealing it.
40 - Forward/reverse Tab traverse input, reveal, cancel, and authorize; rejection, masking, cancellation, and synthetic success remain covered.
41 -- Existing clock/system, Noko overlay, native Niri subscription/workspace/output, and native screenshot checks remain enabled and pass.
43 -## Compact power and empty-panel follow-up
45 -The accepted compact power layout and content-sized empty tray/media states are implemented and visually reviewed.
46 -Power keeps service-owned confirmation, contextual tooltips, and keyboard focus return.
47 -Empty tray/media resize live when service items disappear or return.
48 -[Final evidence](evidence/power-empty-2026-09-06/README.md) records zero-warning lint, 290 `all` assertions, and 152 task assertions at each configured resolution.
49 -The broader acceptance gaps below remain open.
51 -## Validation
53 -The following records the earlier broad repair run; the follow-up above contains the latest scoped evidence.
55 -Run serially from `quickshell/nuguland` after formatting:
57 -- `just fmt`: passed.
58 -- `just test`: passed.
59 -- `just lint`: passed, with zero warnings; includes JS, Rust, format, shader freshness, and the existing runtime gate.
60 -- `just ui-test all`: passed, 261 named interaction assertions at 1280×720, plus direct assertions and complete-log gates.
61 -- `just ui-test tasks 1366x768`: passed, 123 named interaction assertions, plus direct assertions.
62 -- `just ui-test tasks 2560x1440`: passed, 123 named interaction assertions, plus direct assertions.
63 -- `git diff --check -- .`: passed for the Nuguland working tree.
65 -Both configured sizes exercise horizontal and vertical bars at scale 1.
66 -The nested sandbox has a 300-second deadline because the expanded 2560×1440 software-rendered suite exceeded 180 seconds.
67 -Per-command and readiness timeouts remain 30 seconds; no check or diagnostic gate was disabled.
69 -Rendered review covered control states, tooltips, the task panels at both output sizes/orientations, masked/rejected privilege prompts, clock setup, populated resources, and native clipboard paste.
70 -It found and prompted repairs for the vertical Bar fill and the large-output viewport restoration race.
71 -The final vault/Noko screenshots show restored rows inside their actual viewports.
72 -Existing long titles are deliberately elided; overflowing lists scroll within their panels.
74 -Static tests establish logic/source contracts.
75 -Fresh nested runs establish loading and exercised interaction behavior.
76 -Screenshot inspection establishes only the rendered states actually reviewed.
77 -The live-shell lint IPC ping does not prove a fresh production configuration load.
79 -## Remaining blockers and acceptance gaps
81 -1. Inventory item 14 remains unimplemented: real DDC display detection/setup and a verified completion path.
82 - The brightness fixture proves UI behavior, not physical display control or privileged setup.
83 -2. Real vault authentication/MFA/reprompt, Wi-Fi/Bluetooth operations, audio routing/device profiles, media playback, CalDAV synchronization, and speech recognition were not exercised against live services.
84 - Synthetic success is not proof of those integrations.
85 -3. Not every action/state variant has nested coverage.
86 - Add focused fixtures for remaining backend-dependent controls and long-content variants, including Bluetooth pairing, vault setup/MFA/reprompt, the production screenshot popup, long agenda content, and many simultaneous resource issues.
87 - Native screenshot backend coverage does not cover the production screenshot popup.
88 -4. Physical multi-output changes and cross-monitor behavior remain unproven.
89 - Native output-query fixtures are not hardware hotplug tests.
91 -These gaps have not been reconciled with the owner as accepted exclusions.
92 -Do not mark the broad repair contract complete from the passing suites alone.

.system/specs/NL-SPEC-38AED50A-popup-interaction-language/ux-repair.md

Deleted
deleted file mode 100644
1 -# Nuguland UI/UX repair
3 -## Approved direction
5 -Retain every existing feature and the Nugu palette.
6 -Apply the compact, icon-led direction approved in mockup iteration 3.
7 -Use one control language across every widget.
8 -Remove filler subtitles and repetitive instruction labels, not useful status.
9 -Use icons for familiar secondary actions, with useful, Nugu-styled tooltips and accessible names.
10 -Keep primary actions explicit.
11 -Do not copy GNOME branding or Omarchy features into Nuguland.
13 -Reference principles:
15 -- [GNOME design principles](https://developer.gnome.org/hig/principles.html): task simplicity, progressive disclosure, reduced effort, consideration, accessibility.
16 -- [Omarchy Quattro navigation](https://github.com/basecamp/omarchy/blob/quattro/manual/04-navigation.md): complete keyboard operation and direct access.
17 -- [Omarchy Quattro panels](https://github.com/basecamp/omarchy/blob/quattro/manual/05-the-top-bar.md): long-running integrated shell, immediately useful panels, pointer and keyboard actions.
19 -Nuguland resolves conflicts in favor of conventional control traversal: Tab traverses controls, not adjacent panels.
20 -Hover never switches away from an active task.
21 -No new dependencies, feature removals, palette redesign, or parent-desktop testing.
23 -## State and lifecycle contract
25 -Ordinary search, selection, expanded sections, scroll positions and unsent replies belong to shell-lifetime in-memory state, not disposable Loader/delegate instances.
26 -Dismissal is not discard.
27 -Reopening or switching panels restores ordinary state.
28 -Successful completion or an explicit clear/discard action may clear its own state.
29 -Do not persist ordinary drafts to disk.
30 -Passwords and authorization state retain their explicitly defined security lifetimes.
31 -Do not blanket-cache every panel or credential.
32 -Destructive confirmation is cancelled on every dismissal or switch.
34 -Service-derived state remains reactive after local commands.
35 -Commands never replace a view's binding with a returned JSON snapshot.
36 -Live updates preserve row identity while dragging or editing.
37 -Clipboard actions preserve the current filter.
38 -Notification reply failure retains its draft and exposes a retryable outcome.
40 -## Interaction contract
42 -- Explicit activation opens or switches a popup; same-chip activation closes it.
43 -- Each task defines initial focus and returns focus when dismissed.
44 -- Search tasks focus their search editor immediately.
45 -- Escape, outside click and switching use the same lifecycle cleanup route.
46 -- Pointer and keyboard actions have the same meaning and visible feedback.
47 -- Holding activation keys does not repeatedly dispatch commands.
48 -- Tab and Shift+Tab reach all enabled actions without hovering.
49 -- Focused controls are visible, including action rails and notification dismissal.
50 -- Sliders preserve service bindings, full drag sequences and thumb geometry; each has a contextual accessible name.
51 -- Field padding and icon regions focus the editor; empty focused fields retain their hint.
52 -- Capabilities determine whether a control is enabled.
53 -- Async work exposes pending, success or actionable failure, without fabricating completion.
54 -- Clipboard paste must release popup focus and establish destination focus before typing.
55 -- Authentication controls support keyboard traversal without continuous focus theft; no real authentication in tests.
57 -## Visual contract
59 -Use consistent header hierarchy, spacing, radii, icon sizes, action roles and focus treatment.
60 -Neutral surfaces are quiet; primary action, selection, expansion, disabled and error states remain distinct.
61 -Do not border every nested content region.
62 -Status is never color-only.
63 -Tooltips use Nugu surfaces and typography, name the action or explain unavailable state, wrap long text and never show credentials.
64 -Keyboard focus can expose useful tooltips without requiring pointer hover.
65 -All authored labels and tooltip text are lowercase.
66 -Long content stays inside its available geometry and all actions remain reachable by scrolling or disclosure.
67 -Support configured 2560×1440 and 1366×768 outputs at scale 1, horizontal and vertical bars.
69 -## Source-confirmed repair inventory
71 -The initial audit is source evidence, not runtime proof.
73 -1. Loader disposal loses ordinary drafts and scroll state.
74 -2. Hover switching followed by clicking toggles the requested popup closed.
75 -3. Audio, brightness, media, clipboard, power and tray commands sever reactive state bindings.
76 -4. Snapshot array replacement recreates interactive delegates during live updates.
77 -5. Clipboard actions drop filtering; paste has no focus handoff.
78 -6. Hover-only actions and mouse-only rows block keyboard tasks.
79 -7. Custom controls lack standard focus/activation, accessible names, bounded labels and consistent slider geometry.
80 -8. Media exposes unsupported actions as enabled.
81 -9. Power dismissal retains armed destructive confirmation.
82 -10. Launcher details, tray lists and system issues can exceed clipped fixed-height content.
83 -11. Connectivity hides errors; refreshes can destroy the active credential editor.
84 -12. Vault keyboard selection can leave the viewport or retain details after zero matches.
85 -13. Privilege focus retry prevents normal traversal.
86 -14. Brightness DDC setup has no detected-display/completion route; full hardware behavior requires separate verified service work, not a cosmetic success label.
88 -## Acceptance and evidence
90 -Existing checks remain enabled.
91 -Run public `just test`, `just lint` and `just ui-test` gates.
92 -Use `just fmt` and rerun gates after formatting.
93 -Extend the existing nested-niri fixtures for changed flows, with isolated synthetic services.
94 -Do not claim that existing shared-control, Clock/System, Noko-overlay or native-Niri tests cover unexercised panels.
96 -For each repaired flow, record:
98 -- pointer and keyboard activation, disabled behavior and exactly-once writes;
99 -- edits and selection through close/reopen and switching;
100 -- external updates after a local action;
101 -- pending/failure/empty/long-content states;
102 -- actual rendered screenshots, reviewed for clipping, hierarchy, focus and state feedback;
103 -- tested output geometry, commands and retained complete logs.
105 -Track delivered slices and remaining blockers in `repair-progress.md`, not in SYSTEM.md or MISSION.md.
106 -Completion requires the entire inventory to be resolved or explicitly reconciled with the owner, not merely a passing control demonstration.

.system/specs/NL-SPEC-5F4166AF-audio-popup/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-5F4166AF
3 -type: spec
4 -title: Audio popup
5 ----
7 -# Audio popup
9 -## Behavior
11 -- The popup presents lowercase `output` and `input` sections backed by current PipeWire devices.
12 -- Each device row shows a speaker or microphone state glyph, device name, volume slider, and percentage from 0% through 150%.
13 -- Muted rows show a muted glyph and reduced emphasis.
14 -- Default devices use selected card border and fill without an exposed accent sliver.
15 -- Clicking or dragging a slider changes volume; middle click toggles mute.
16 -- Selecting a device name makes it the default output or input.
17 -- Empty sections remain valid.
18 -- The bar privacy indicator reports microphone and camera activity with a lowercase label.
20 -## Constraints
22 -- PipeWire remains the authoritative audio boundary.
23 -- Volume is clamped to 0 through 1.5.
24 -- Missing names use a stable fallback; missing default devices produce no selected row.
25 -- Existing audio, privacy, routing, and self-test IPC remains available.
26 -- State retains consumed sinks, sources, streams, default IDs, privacy, and action results.
27 -- State excludes backend narration and unused shader descriptions.
28 -- Existing stream routing remains available, but no new routing UI is required.
30 -## Acceptance
32 -- Pure tests cover volume boundaries, percentages, name precedence, mute and role state, privacy combinations, row shaping, glyphs, and ID lookup.
33 -- Runtime self-test passes.
34 -- Live checks confirm privacy, volume routes, sliders, mute, and default selection.
35 -- The popup uses shared controls and contains no audio card accent sliver.

.system/specs/NL-SPEC-7945430A-clipboard-popup/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-7945430A
3 -type: spec
4 -title: Clipboard popup
5 ----
7 -# Clipboard popup
9 -## Behavior
11 -- History is ordered with pinned items first, then newest capture.
12 -- Search matches title and body without changing that ordering.
13 -- Rows distinguish image, color, URL, path, and text content.
14 -- Image rows show bounded asynchronous thumbnails with an image-icon fallback.
15 -- Valid hex and RGB colors show a swatch; malformed colors remain text.
16 -- Each row shows a concise title plus lowercase kind and age metadata.
17 -- Copy, paste, pin, and delete are compact icon actions.
18 -- Actions may appear on hover but remain keyboard reachable.
19 -- Pinned rows have a non-color-only selected indication.
20 -- Private mode remains directly visible and prevents new captures.
21 -- History persists atomically and remains capped.
23 -## Constraints
25 -- Unreadable, binary, and oversized captures are ignored.
26 -- Malformed persisted history recovers to empty valid history without crashing.
27 -- Thumbnail failure does not remove access to an item or its actions.
28 -- Capture remains limited to the existing text watch and temporary image-path flow.
29 -- Existing clipboard and launcher-facing IPC remains available and stable.
30 -- State responses contain functional state, not view narration.
32 -## Acceptance
34 -- Pure checks cover readability, type detection, color parsing, image paths, ordering, filtering, age buckets, and row shaping.
35 -- Runtime self-test passes.
36 -- A live visual check confirms recency, thumbnails and fallback, swatches, type icons, private mode, and keyboard-reachable actions.

.system/specs/NL-SPEC-83056D8D-nugu-desktop-theme-switching/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-83056D8D
3 -type: spec
4 -title: Nugu desktop theme switching
5 ----
7 -# Nugu desktop theme switching
9 -## Contract
11 -- Nugu is the sole palette source for generated desktop themes.
12 -- Valid modes are `dark` and `light`.
13 -- Missing or invalid persisted state resolves to `dark`.
14 -- Public operations select either mode, toggle, report current status, or prepare runtime artifacts without reload.
15 -- Status reads effective mode without writes or reloads.
16 -- A mode change updates the desktop color-scheme preference and every enabled consumer supporting that mode.
17 -- Nuguland and all other mode-aware consumers observe the same effective mode.
19 -## Runtime state
21 -- Runtime state belongs under the Nugu directory in XDG state home.
22 -- Runtime artifacts contain palette-derived colors and styling only.
23 -- Layout, behavior, bindings, modules, and timeouts remain consumer-owned.
24 -- Runtime switching never edits tracked files or symlink targets inside the dotfiles repository.
26 -## Safety
28 -- Switching between modes and back leaves repository status unchanged.
29 -- Live updates preserve unrelated application and session state.
30 -- Consumer restart is allowed only when no reliable live-update path exists.
31 -- Retired consumers do not constrain runtime artifacts.
33 -## Acceptance
35 -- Missing and invalid state select `dark`.
36 -- Selection, toggle, preparation, and status have the specified effects.
37 -- Dark and light artifacts are deterministic and palette-derived.
38 -- Desktop preference consistently reflects the selected mode.
39 -- A complete light-to-dark round trip creates no dotfiles diff.
40 -- Enabled visual consumers are readable and consistent in both modes.
41 -- Final visual acceptance is human-confirmed.

.system/specs/NL-SPEC-86A037A0-nuguland-companion-shell/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-86A037A0
3 -type: spec
4 -title: Nuguland companion shell
5 ----
7 -# Nuguland companion shell
9 -## Outcome
11 -One named Nuguland shell owns the desktop companion UI.
12 -Compositor, session, idle, lock, clipboard-storage, and authorization primitives remain separate unless an approved replacement is safer and simpler.
14 -## Required surfaces
16 -- One bar appears on the configured primary output and represents workspaces from all relevant outputs.
17 -- The bar exposes workspace navigation, clock and calendar, media, notifications, tray, resources, audio, brightness, connectivity, clipboard, launcher, idle inhibition, and power controls.
18 -- Popouts expose full interaction and dismiss predictably by outside click or Escape.
19 -- Native notifications provide urgency, actions, history, dismissal, and do-not-disturb behavior without a competing daemon.
20 -- Launcher and clipboard surfaces support keyboard navigation, selection, Escape dismissal, and empty states.
21 -- OSD and capture actions report success or failure without changing underlying action semantics.
22 -- Destructive session actions require confirmation.
23 -- Lock and suspend preserve safe ordering and the session lock boundary.
25 -## Interface constraints
27 -- Public IPC is stable at the behavior level.
28 -- Existing state JSON contracts evolve additively.
29 -- External command boundaries are narrow, explicit, and inspectable.
30 -- Shared services enter components through the shell composition root, not hidden global state.
31 -- All UI labels are lowercase.
33 -## Visual constraints
35 -- Nugu semantic roles are the visual source of truth.
36 -- Active controls use focus semantics, hover uses accent semantics, muted content uses minor semantics, and failures use warning or error semantics.
37 -- IBM Plex Sans is the UI font.
38 -- IBM Plex Mono is used for fixed-width status or numeric alignment.
39 -- Components remain usable in both Nugu modes.
41 -## Migration and safety
43 -- Replacement surfaces reach functional and visual parity before incumbent frontends retire.
44 -- Notification ownership changes under a proven rollback guard and never intentionally leaves two daemons competing.
45 -- Security-sensitive agents and lock behavior remain until separately specified and approved.
46 -- Retirement removes live references and service enablement.
47 -- Package removal is separate scope.
49 -## Acceptance
51 -- The shell starts through the graphical-session service without QML errors or warnings.
52 -- Every visible control passes its interaction matrix, including failure paths.
53 -- Workspace state updates without polling helpers.
54 -- Destructive actions cannot execute without confirmation.
55 -- Exactly one notification daemon owns the notification bus.
56 -- No retired frontend remains on a live configuration path.
57 -- Dark and light visual checks pass when theme switching is enabled.
58 -- The shell remains recoverable through a documented service rollback.

.system/specs/NL-SPEC-8EQ0TRBZ-nuguland-vault-widget/index.md

Deleted
deleted file mode 100644
1 ----
2 -schemaVersion: 0
3 -id: NL-SPEC-8EQ0TRBZ
4 -type: spec
5 -title: Nuguland vault widget
6 ----
8 -# Nuguland vault widget
10 -## Outcome
12 -A Nuguland bar widget provides the small daily Vaultwarden surface Oliver needs:
13 -search, inspect, reveal, copy, open, favorite, and use TOTP codes without opening a full vault client.
15 -The widget follows the [Nuguland popup interaction language](../NL-SPEC-38AED50A-popup-interaction-language/index.md).
17 -## Behavior
19 -- Activating the vault widget opens a split popout with search and results on the left and the selected item's details on the right.
20 -- Search covers the vault's useful item metadata and updates results while typing.
21 -- Keyboard and pointer input can search, move selection, activate actions, and dismiss the popout.
22 -- A global Niri shortcut opens the popout from any workspace and focuses search.
23 -- When a browser is focused, exact origin matches are promoted using its locally observed address; a manual query remains authoritative.
24 -- Context shortcuts copy the selected item's username, password, current TOTP, or next TOTP when available.
25 -- Successful copies provide transient field-specific feedback without displaying the copied value.
26 -- Favorites appear in a distinct group before all other matching items.
27 -- An item can be favorited or unfavorited from its detail view.
28 -- Closing and reopening restores the query, selected item, result scroll position, detail scroll position, expanded sections, and reveal state.
29 -- Retained state survives popout closure, not vault locking or shell termination.
30 -- Loading, empty, locked, authentication-failure, sync-failure, stale-cache, and unavailable-vault states are explicit and actionable.
31 -- Opening requests a sync without blocking usable encrypted cached data during network loss.
33 -## Unlock and configuration
35 -- One named profile selects the server URL, account identifier, and nonsecret behavior settings.
36 -- First use shows a calendar-style setup form for server URL and account; neither has a hardcoded default.
37 -- The settings action locks the vault before editing; cancel leaves the saved profile unchanged.
38 -- Saving validates the profile in the native boundary before persisting nonsecret JSON through Quickshell.
39 -- Changing server or account clears retained state and selects separate encrypted-cache, credential-storage, and favicon namespaces.
40 -- The required deployment targets `https://vault.bugabinga.net`; the same profile shape also targets official Bitwarden.
41 -- Credentials, tokens, master passwords, and derived keys are never configuration values.
42 -- Locking, suspend, and restart clear decrypted keys and in-memory access tokens, not the saved server login.
43 -- Refresh credentials and account-bound wrapped unlock material persist only in Secret Service.
44 -- A saved login unlocks locally with the master password, then syncs using refreshed access credentials without repeating email verification.
45 -- A missing cache can be rebuilt from the saved login without repeating second-factor authentication.
46 -- Transport failures preserve the saved login and usable cached data; definitive refresh rejection clears the saved login and locks the vault until interactive reauthentication.
47 -- Refreshed credentials are persisted before their access token is used; missing or unavailable protected storage is never replaced by plaintext storage.
48 -- Locked state shows only profile identity, cache freshness, and an in-widget master-password field.
49 -- Submitting sends the master password once to the isolated native vault boundary, then immediately clears the field.
50 -- The master password is never retained as UI state; only derived keys survive until timeout or lock.
51 -- Invalid input is cleared before another attempt.
52 -- Server-required login and second-factor challenges remain inside the locked flow and never expose vault metadata.
53 -- Closing the popout hides, rather than cancels, authentication; the challenge, selected method, and unsubmitted verification-code draft survive reopening in memory.
54 -- Closing still clears master-password and re-prompt inputs; explicit cancel, lock, timeout, suspend, and shell exit clear the pending authentication state.
55 -- Selecting email verification shows an inline inbox instruction and focuses the code field; it does not claim email delivery confirmation.
56 -- Submitting a verification code clears its draft immediately and shows a pending state until the native response arrives.
58 -The local `Quickshell.statePath("vault.json")` file uses this nonsecret profile shape.
59 -This example is not a default:
61 -```json
63 - "name": "personal",
64 - "serverUrl": "https://vault.example.com",
65 - "account": "user@example.com",
66 - "unlockTimeoutSeconds": 900,
67 - "clipboardTimeoutSeconds": 30
69 -```
71 -`serverUrl` accepts HTTPS Vaultwarden deployments or `https://vault.bitwarden.com` for official Bitwarden.
72 -Timeout values are seconds.
74 -## Item details
76 -- Every item type returned by Vaultwarden is usable, including login, secure note, card, identity, and SSH key items.
77 -- Standard and custom fields are shown with their names, values, sensitivity, and applicable actions intact.
78 -- Textual values can be copied.
79 -- Sensitive values are concealed by default and have separate reveal and copy actions.
80 -- URL values can be opened through the desktop portal or copied.
81 -- Attachments and unsupported field actions are identified without hiding the rest of the item.
82 -- URL-bearing items use a cached favicon; absent or failed favicons fall back to an item-type icon.
83 -- Icon-only actions have tooltips, accessible names, and visible hover, press, and keyboard-focus states.
85 -## TOTP
87 -- Items with TOTP show the current code, next code, and remaining time.
88 -- Clicking either code copies that displayed code.
89 -- At rollover, current and next advance together without changing selection or focus.
90 -- Items without TOTP omit the TOTP region.
92 -## Constraints
94 -- Vault content is read-only except for favorite state.
95 -- Vault access runs through a process-isolated native Rust boundary owned by Nuguland.
96 -- The unforked official Bitwarden Rust SDK supplies cryptography and reusable models/APIs, subject to this spec's security and behavior constraints.
97 -- Nuguland's native boundary implements only missing request/response handling required by this spec; item metadata must not be silently discarded.
98 -- `rbw` is reference material, including [PR #319](https://github.com/doy/rbw/pull/319), not a library dependency or maintained fork.
99 -- Nuguland-written cryptographic implementations remain forbidden.
100 -- Desktop integration uses native Wayland, Linux, and Quickshell APIs; X11 and Xwayland are not dependencies.
101 -- Node runtimes, `bw` and `rbw` CLI executables, `rbw-agent`, browser extensions, and persistent standalone daemons are not runtime dependencies.
102 -- Quickshell owns presentation and retained navigation state; the native boundary owns authentication, cryptography, sync, encrypted cache, and browser-context inspection.
103 -- Creating, editing, deleting, sharing, autofill, password generation, and vault administration are outside scope.
104 -- Configured Vaultwarden or Bitwarden account and lock boundaries remain authoritative.
105 -- Locked state exposes no item metadata or secrets.
106 -- Master passwords never enter process arguments, environment variables, logs, retained properties, or persistent storage.
107 -- Decrypted values, retained UI state, search terms, and copied secrets are never logged or persisted to disk.
108 -- Persistent cache contains only Bitwarden-encrypted vault payloads; authentication material uses protected credential storage.
109 -- Explicit copies are the only path from vault secrets to the system clipboard.
110 -- Secret copies do not enter Nuguland clipboard history and require no Niri clipboard changes.
111 -- Secret clipboard values expire after a short interval, but clearing never overwrites a subsequently changed clipboard.
112 -- Browser context uses local Linux accessibility and session interfaces; browser extensions and remote-debugging protocols are outside scope.
113 -- The observed browser address is neither persisted nor sent across the network.
114 -- Offline data remains encrypted at rest; no decrypted offline cache is introduced.
115 -- Favicon retrieval and caching disclose no vault contents to third-party favicon aggregators.
116 -- All visible labels are lowercase and both Nugu modes remain usable.
118 -## Accepted design
120 -[Open the accepted split-view mockup](vault-widget.html).
121 -[Open the accepted in-widget unlock mockup](vault-unlock.html).
123 -The search/result pane remains visible beside the detail pane.
124 -Favorites are grouped first, URL-bearing items use cached favicons, and actions use icons rather than text labels.
125 -The detail pane adapts to every Vaultwarden item type.
126 -Locked state replaces vault content with the integrated master-password flow.
128 -## Acceptance
130 -- First use, save, reload, edit, cancel, invalid settings, and failed persistence work without a tracked account profile.
131 -- Profile changes lock immediately, wait for native cleanup, and cannot reuse another identity's cache or late favicon results.
132 -- The configured profile connects to `vault.bugabinga.net` without embedding credentials in Nuguland configuration.
133 -- The same behavior contract passes against an official Bitwarden profile without UI changes.
134 -- Locked state reveals no item metadata and accepts the master password inside the widget.
135 -- Submit, cancel, invalid input, timeout, explicit lock, suspend, and shell exit leave no master password in UI state, arguments, environment, logs, or disk.
136 -- On-disk inspection finds no decrypted item values or plaintext authentication material.
137 -- Dependency and runtime inspection confirms no `rbw` library, Node runtime, `bw` or `rbw` CLI executable, `rbw-agent`, or standalone vault daemon dependency.
138 -- Desktop flows pass in a native Wayland session without Xwayland or an X11 server.
139 -- Search finds representative items of every supported type and selection updates the detail pane.
140 -- The Niri shortcut opens and focuses the widget from every workspace.
141 -- A focused browser promotes exact origin matches through the Linux-native route; unavailable browser context leaves retained state unchanged.
142 -- Context shortcuts copy each available target and report success without revealing its value.
143 -- Favorite toggling immediately moves matching items into or out of the favorites group and remains correct after vault sync.
144 -- Every supported item type exposes all available standard and custom fields without leaking concealed values.
145 -- Current and next TOTP values match independent generation before, during, and after a rollover; clicking each copies the shown value.
146 -- Query, selection, both scroll positions, expanded sections, and reveal state are unchanged after close and reopen.
147 -- Locking clears retained vault state and removes all item metadata and secrets from the surface.
148 -- Favicon cache hit, miss, failure, and fallback behavior work without third-party favicon aggregation.
149 -- Secret copy actions bypass Nuguland clipboard history, expire conditionally, and never overwrite newer clipboard content.
150 -- Cached vault items remain usable during network loss, while sync freshness and failures remain visible.
151 -- URL opening uses the desktop portal.
152 -- Pointer and keyboard flows, locked and failure states, both theme modes, and zero-warning lint pass.

.system/specs/NL-SPEC-8EQ0TRBZ-nuguland-vault-widget/vault-unlock.html

Deleted
deleted file mode 100644
1 -<!doctype html>
2 -<html lang="en">
3 -<head>
4 -<meta charset="utf-8">
5 -<meta name="viewport" content="width=device-width, initial-scale=1">
6 -<title>nuguland vault unlock</title>
7 -<style>
8 -* { box-sizing: border-box; }
9 -body { margin: 0; background: #121212; }
10 -.vault {
11 - --bg: #121212;
12 - --panel: #242424;
13 - --panel2: #303030;
14 - --text: #ededed;
15 - --muted: #9d9d9d;
16 - --line: #ffffff38;
17 - --accent: #d86dd8;
18 - --focus: #9aabae;
19 - width: min(920px, 96vw);
20 - height: 580px;
21 - margin: 14px auto;
22 - padding: 14px;
23 - border: 1px solid var(--line);
24 - border-radius: 14px;
25 - background: var(--panel);
26 - color: var(--text);
27 - font: 14px/1.25 "IBM Plex Sans", sans-serif;
28 - display: grid;
29 - grid-template-columns: 335px 1fr;
30 - overflow: hidden;
31 -}
32 -button, input { font: inherit; color: inherit; }
33 -button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
34 -.browser { padding-right: 14px; border-right: 1px solid var(--line); min-width: 0; }
35 -.search { height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 13px; font-family: "IBM Plex Mono", monospace; font-size: 16px; color: var(--muted); }
36 -.lockedlist { height: 450px; display: grid; place-items: center; color: var(--muted); font: 12px "IBM Plex Mono", monospace; }
37 -.detail { display: grid; place-items: center; padding: 24px; }
38 -.unlock { width: min(390px, 100%); text-align: center; }
39 -.lock { width: 66px; height: 66px; margin: 0 auto 18px; border: 1px solid #d86dd870; border-radius: 18px; background: #d86dd810; display: grid; place-items: center; color: var(--accent); }
40 -.lock svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
41 -.unlock h1 { font-size: 25px; margin: 0 0 7px; }
42 -.account { color: var(--muted); font: 12px/1.5 "IBM Plex Mono", monospace; margin-bottom: 24px; }
43 -.pwrow { height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: grid; grid-template-columns: 1fr auto auto; align-items: center; padding-left: 13px; gap: 6px; }
44 -.pw { width: 100%; border: 0; outline: 0; background: transparent; font: 15px "IBM Plex Mono", monospace; }
45 -.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: pointer; margin-right: 5px; }
46 -.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
47 -.go { background: var(--accent); color: var(--bg); border-color: var(--accent); }
48 -.go:hover { color: var(--bg); filter: brightness(1.1); }
49 -.svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
50 -.hint { margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.45; }
51 -.status { margin-top: 27px; padding-top: 13px; border-top: 1px solid #ffffff20; color: var(--muted); font: 11px "IBM Plex Mono", monospace; }
52 -.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
53 -</style>
54 -</head>
55 -<body>
56 -<main class="vault">
57 - <section class="browser">
58 - <input class="search" aria-label="search vault" placeholder="search vault" disabled>
59 - <div class="lockedlist">unlock to search vault</div>
60 - </section>
61 - <section class="detail">
62 - <div class="unlock">
63 - <div class="lock"><svg viewBox="0 0 24 24"><rect x="4" y="10" width="16" height="11" rx="3"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></div>
64 - <h1>unlock vault</h1>
65 - <div class="account">vault.bugabinga.net<br>personal account</div>
66 - <div class="pwrow">
67 - <input class="pw" type="password" aria-label="master password" placeholder="master password" autofocus>
68 - <button class="iconbtn" aria-label="show master password" title="show master password"><svg class="svg" viewBox="0 0 24 24"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
69 - <button class="iconbtn go" aria-label="unlock vault" title="unlock vault"><svg class="svg" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></svg></button>
70 - </div>
71 - <div class="hint">the password is sent once to the isolated native vault process, then cleared from the widget</div>
72 - <div class="status"><span class="dot"></span>encrypted cache ready · last sync 8m ago</div>
73 - </div>
74 - </section>
75 -</main>
76 -</body>
77 -</html>

.system/specs/NL-SPEC-8EQ0TRBZ-nuguland-vault-widget/vault-widget.html

Deleted
deleted file mode 100644
1 -<!doctype html>
2 -<html lang="en">
3 -<head>
4 -<meta charset="utf-8">
5 -<meta name="viewport" content="width=device-width, initial-scale=1">
6 -<title>nuguland vault widget</title>
7 -<style>
8 -* { box-sizing: border-box; }
9 -body { margin: 0; background: #121212; }
10 -.vault {
11 - --bg: #121212;
12 - --panel: #242424;
13 - --panel2: #303030;
14 - --text: #ededed;
15 - --muted: #9d9d9d;
16 - --line: #ffffff38;
17 - --accent: #d86dd8;
18 - --focus: #9aabae;
19 - width: min(920px, 96vw);
20 - height: 580px;
21 - margin: 14px auto;
22 - padding: 14px;
23 - border: 1px solid var(--line);
24 - border-radius: 14px;
25 - background: var(--panel);
26 - color: var(--text);
27 - font: 14px/1.25 "IBM Plex Sans", sans-serif;
28 - display: grid;
29 - grid-template-columns: 335px 1fr;
30 - overflow: hidden;
32 -button, input { font: inherit; color: inherit; }
33 -button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
34 -.browser { padding-right: 14px; border-right: 1px solid var(--line); min-width: 0; overflow: hidden; }
35 -.search { height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 13px; font-family: "IBM Plex Mono", monospace; font-size: 16px; }
36 -.sectionlabel { color: var(--muted); font: 11px "IBM Plex Mono", monospace; margin: 13px 3px 5px; }
37 -.results { display: grid; gap: 4px; }
38 -.item { width: 100%; height: 55px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; padding: 7px 8px; display: grid; grid-template-columns: 36px 1fr 25px; gap: 9px; align-items: center; cursor: pointer; }
39 -.item:hover { background: #ffffff0b; }
40 -.item.on { background: #d86dd81c; border-color: #d86dd875; }
41 -.favicon { width: 34px; height: 34px; border-radius: 8px; background: #ededed; object-fit: contain; padding: 5px; }
42 -.typeicon { width: 34px; height: 34px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--accent); font: 16px "IBM Plex Mono", monospace; }
43 -.title { font-weight: 600; }
44 -.meta { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
45 -.pin { color: var(--accent); font-size: 15px; text-align: center; }
46 -.detail { padding: 5px 4px 0 22px; min-width: 0; overflow: hidden; }
47 -.head { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 12px; height: 51px; }
48 -.head .favicon { width: 48px; height: 48px; border-radius: 12px; padding: 7px; }
49 -.head h1 { font-size: 23px; margin: 0; }
50 -.head p { margin: 4px 0 0; color: var(--muted); font: 12px "IBM Plex Mono", monospace; }
51 -.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: pointer; font-size: 17px; }
52 -.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
53 -.totp { margin-top: 18px; padding: 15px; border: 1px solid #d86dd870; border-radius: 12px; background: #d86dd810; display: grid; grid-template-columns: 1fr 135px; gap: 16px; }
54 -.label { color: var(--muted); font: 11px "IBM Plex Mono", monospace; margin-bottom: 7px; }
55 -.code { border: 0; background: transparent; padding: 0; text-align: left; font: 700 34px/1 "IBM Plex Mono", monospace; letter-spacing: 5px; cursor: pointer; }
56 -.code:hover { color: var(--accent); }
57 -.hint { color: var(--muted); font-size: 11px; margin-top: 8px; }
58 -.next { border-left: 1px solid var(--line); padding-left: 16px; }
59 -.next .code { font-size: 18px; letter-spacing: 2px; }
60 -.count { margin-top: 10px; color: var(--accent); font: 12px "IBM Plex Mono", monospace; }
61 -.fields { display: grid; gap: 7px; margin-top: 15px; }
62 -.field { height: 55px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 8px 9px 8px 12px; min-width: 0; }
63 -.value { font: 14px "IBM Plex Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
64 -.actions { display: flex; gap: 5px; }
65 -.subtle { font-size: 12px; color: var(--muted); margin-top: 11px; }
66 -.svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
67 -</style>
68 -</head>
69 -<body>
70 -<main class="vault">
71 - <section class="browser">
72 - <input class="search" aria-label="search vault" placeholder="search vault">
73 - <div class="sectionlabel">favorites</div>
74 - <div class="results">
75 - <button class="item on"><img class="favicon" src="https://github.com/favicon.ico" alt=""><span><span class="title">github</span><span class="meta">login · oliver@bugabinga.net</span></span><span class="pin">★</span></button>
76 - <button class="item"><img class="favicon" src="https://codeberg.org/assets/img/favicon.svg" alt=""><span><span class="title">codeberg</span><span class="meta">login · bugabinga</span></span><span class="pin">★</span></button>
77 - </div>
78 - <div class="sectionlabel">all items</div>
79 - <div class="results">
80 - <button class="item"><span class="typeicon">▣</span><span><span class="title">daily card</span><span class="meta">card · visa ending 4242</span></span><span></span></button>
81 - <button class="item"><span class="typeicon">◎</span><span><span class="title">oliver jan krylow</span><span class="meta">identity · personal</span></span><span></span></button>
82 - <button class="item"><span class="typeicon">≡</span><span><span class="title">recovery codes</span><span class="meta">secure note</span></span><span></span></button>
83 - <button class="item"><span class="typeicon">⌁</span><span><span class="title">vcs deploy</span><span class="meta">ssh key · ed25519</span></span><span></span></button>
84 - </div>
85 - </section>
86 - <section class="detail">
87 - <header class="head">
88 - <img class="favicon" src="https://github.com/favicon.ico" alt="">
89 - <div><h1>github</h1><p>login · personal</p></div>
90 - <button class="iconbtn" aria-label="unpin favorite" title="unpin favorite">★</button>
91 - </header>
92 - <section class="totp">
93 - <div><div class="label">current code</div><button class="code" title="copy current code">824 193</button><div class="hint">click code to copy</div></div>
94 - <div class="next"><div class="label">next</div><button class="code" title="copy next code">391 420</button><div class="count">18s remaining</div></div>
95 - </section>
96 - <section class="fields">
97 - <div class="field">
98 - <div><div class="label">username</div><div class="value">oliver@bugabinga.net</div></div>
99 - <div class="actions"><button class="iconbtn" aria-label="copy username" title="copy username"><svg class="svg" viewBox="0 0 24 24"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3"/></svg></button></div>
100 - </div>
101 - <div class="field">
102 - <div><div class="label">password</div><div class="value">••••••••••••••••</div></div>
103 - <div class="actions">
104 - <button class="iconbtn" aria-label="view password" title="view password"><svg class="svg" viewBox="0 0 24 24"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
105 - <button class="iconbtn" aria-label="copy password" title="copy password"><svg class="svg" viewBox="0 0 24 24"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3"/></svg></button>
106 - </div>
107 - </div>
108 - <div class="field">
109 - <div><div class="label">website</div><div class="value">github.com</div></div>
110 - <div class="actions">
111 - <button class="iconbtn" aria-label="open website" title="open website"><svg class="svg" viewBox="0 0 24 24"><path d="M14 3h7v7M10 14 21 3M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"/></svg></button>
112 - <button class="iconbtn" aria-label="copy website" title="copy website"><svg class="svg" viewBox="0 0 24 24"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3"/></svg></button>
113 - </div>
114 - </div>
115 - </section>
116 - <div class="subtle">additional fields continue below · selected item and position survive close/open</div>
117 - </section>
118 -</main>
119 -</body>
120 -</html>

.system/specs/NL-SPEC-9D4A99C2-read-only-caldav-calendar/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-9D4A99C2
3 -type: spec
4 -title: Read-only CalDAV calendar
5 ----
7 -# Read-only CalDAV calendar
9 -## Outcome
11 -The clock popup shows the current six-week month grid and today's agenda from one Nextcloud CalDAV account.
12 -It remains useful offline and before setup.
14 -## Data behavior
16 -- Event and task calendars are discovered rather than hardcoded; disabled calendars are excluded.
17 -- Recurring events arrive expanded by the server.
18 -- Task queries are not recurrence-expanded because expansion can drop VTODO data.
19 -- The fetched window covers all 42 visible Monday-first cells.
20 -- Timed values become local display times from UTC instants.
21 -- All-day values remain calendar dates without timezone conversion.
22 -- Folded lines, escaped text, exclusive all-day end dates, timed events, and dated tasks parse defensively.
23 -- Invalid records are skipped without discarding valid records; undated tasks are ignored.
25 -## Presentation
27 -- Timed single-day events render as calendar-colored dots; all-day events render as pills.
28 -- Multi-day events render as non-overlapping bands split at week boundaries.
29 -- Today is emphasized and adjacent-month days are subdued.
30 -- Weekday labels are lowercase `m d m d f s s`, with weekends dimmed.
31 -- Today's agenda lists all-day items and tasks before timed events.
32 -- Open tasks use `○`, completed tasks are subdued, and timed events show local time.
33 -- Empty agenda text is `keine termine`.
34 -- The grid has a fixed six-row height and remains borderless, without gradients, shadows, or animation.
36 -## Setup, refresh, and failure
38 -- Initial setup collects a server URL, username, and app-password.
39 -- Setup explicitly says to use an app-password, not the main password.
40 -- Non-secret configuration and discovered metadata persist across restarts.
41 -- Data refreshes on initial load, when the popup opens, and every 15 minutes.
42 -- Missing configuration or credentials presents lowercase setup affordances.
43 -- Network, authentication, keyring, or parse failure never breaks the clock or grid.
44 -- Failure preserves last-good data and shows a subtle stale marker.
45 -- Keyring failure produces an inline, lowercase, actionable error.
47 -## Security and contracts
49 -- Calendar access permits DAV discovery and reads only.
50 -- The app-password is stored in the system keyring.
51 -- The password is never persisted in calendar configuration, written to disk, placed in process arguments, logged, or returned through IPC.
52 -- Transient password state is cleared after successful storage.
53 -- Additive IPC exposes status, non-secret account identity, counts, and setup booleans, never credentials.
55 -## Acceptance
57 -- Parser and layout checks cover unfolding, escaping, dates, tasks, malformed input, week wrapping, and overlapping lanes.
58 -- Service checks cover discovery, timezone-independent windows, setup drafts, and state serialization.
59 -- A live read discovers calendars and returns events and dated tasks without credential exposure.
60 -- Offline and missing-keyring tests preserve the shell and show the specified state.
61 -- Screenshots verify grid, bands, agenda ordering, stale state, setup guidance, and lowercase labels.
63 -## Out of scope
65 -- Month navigation or day selection.
66 -- Calendar mutation, multiple accounts, client-side recurrence, or cross-restart event caching.
67 -- Undated tasks, subtasks, and calendar alarms.

.system/specs/NL-SPEC-C24FF4FA-power-popup/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-C24FF4FA
3 -type: spec
4 -title: Power popup
5 ----
7 -# Power popup
9 -## Power state
11 -- A main battery hero appears only for a real laptop or display battery.
12 -- The hero shows circular percentage, lowercase state, time estimate, health when available, and the existing charge role.
13 -- Desktops never show a fake battery.
14 -- External battery devices appear as compact chips below the hero.
15 -- Without battery data, session actions become the first content.
16 -- Global low-power mode continues to reflect discharge state for animation throttling.
18 -## Session actions
20 -- `lock` is the primary safe action.
21 -- `suspend`, `monitor-off`, and `monitor-on` are secondary one-click actions.
22 -- `logout`, `reboot`, and `poweroff` occupy a separate danger region.
23 -- Destructive actions require two steps.
24 -- While confirmation is pending, the danger region becomes a focused card with the lowercase action name, `confirm`, and `cancel`.
25 -- Enter confirms and Escape cancels without on-screen keyboard instructions.
26 -- Existing real session effects remain unchanged.
27 -- No fake power-profile selector appears without a working profile service.
29 -## Safety and interface constraints
31 -- Session commands use fixed discrete argument vectors without shell interpolation or sudo.
32 -- Verification never executes logout, reboot, or poweroff; it covers their confirmation gate and route only.
33 -- Existing power, confirmation, low-power, and self-test IPC remains available.
34 -- State retains battery status, external devices, actions, compact state, pending confirmation, and last action.
35 -- State excludes backend narration and fake profile state.
37 -## Acceptance
39 -- Pure tests cover battery normalization, time and state labels, roles, battery detection, low-power detection, confirmation, and every route.
40 -- Runtime self-test passes without executing destructive actions.
41 -- A live visual check confirms battery-present and battery-absent layouts, external chips, safe and danger grouping, and in-place confirmation.
42 -- All UI labels are lowercase.

.system/specs/NL-SPEC-C49F734E-notification-surfaces-and-lifecycle/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-C49F734E
3 -type: spec
4 -title: Notification surfaces and lifecycle
5 ----
7 -# Notification surfaces and lifecycle
9 -## Outcome
11 -Notifications form one coherent system across a bar widget, persistent popup history, and transient toasts.
13 -## Behavior
15 -- The widget exposes unread or active state without rendering a card.
16 -- The popup renders full cards grouped by application.
17 -- Toasts render compact cards on the primary screen when notifications arrive.
18 -- Reusing a protocol ID updates its history row and visible toast without duplication or reordering.
19 -- Transient notifications may appear as toasts but never enter history.
20 -- Invoking an action closes a non-resident notification; resident notifications remain.
21 -- Dismissing a toast preserves history; closing a card removes that notification.
22 -- `clear all` removes history and visible toasts.
23 -- `dnd` immediately removes and suppresses low and normal toasts.
24 -- Critical toasts bypass `dnd` and remain until dismissed.
25 -- `SUPER+ESC` dismisses every visible toast, including critical toasts, without deleting history.
26 -- Positive expiry uses the supplied duration, unspecified expiry uses five seconds, and zero is sticky.
28 -## Rendering
30 -- Full cards show the resolved application icon, application name, relative time, summary, wrapped body, optional image, and server actions.
31 -- Compact cards show the resolved icon, summary, urgency, and applicable progress or lifetime state.
32 -- Named icons use theme lookup; image paths and URLs render as images.
33 -- Critical urgency is destructive, normal urgency is accented, and low urgency is subdued.
34 -- Full cards expose close, explicit copy, optional progress, and inline reply only when advertised.
35 -- User-facing labels are lowercase.
36 -- Drag-to-dismiss, debug metadata, cryptic count pills, and unused telemetry are absent.
38 -## Contracts and safety
40 -- Notification state remains additive and exposes active toast rows separately from history.
41 -- Copying body text requires explicit user action.
42 -- Native notification references are released when neither history nor a toast needs them.
43 -- Destructive history clearing is button-only and has no implicit keyboard route.
45 -## Acceptance
47 -- Isolated checks cover replacement, read preservation, `dnd`, critical bypass, sticky timeout, transient exclusion, and toast dismissal.
48 -- Real notifications verify icons, wrapping, images, actions, replacement, expiry, critical persistence, and `dnd`.
49 -- Screenshots confirm full and compact layouts and lowercase labels.
50 -- Popup history scrolls, the shortcut dismisses toasts end to end, and runtime logs contain no QML errors.

.system/specs/NL-SPEC-F1CFB1D7-connectivity-popup/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-F1CFB1D7
3 -type: spec
4 -title: Connectivity popup
5 ----
7 -# Connectivity popup
9 -## Wi-Fi behavior
11 -- iwd is the single Wi-Fi read and write authority.
12 -- The active station device is discovered rather than assumed from an interface name.
13 -- Rows retain iwd order and show connection state and signal strength.
14 -- Refresh races retain known managed rows rather than flashing an empty list.
15 -- Users can scan, connect, disconnect, forget, and toggle Wi-Fi.
16 -- Scan remains visibly active while asynchronous results settle.
17 -- An already-running scan is not shown as a hard failure.
18 -- Open and known networks connect directly.
19 -- A new secured network reveals an inline password field, submits once, and clears immediately.
20 -- Buttons visibly react to hover and press.
22 -## Bluetooth and connectivity
24 -- The existing native Bluetooth list and actions remain unchanged and refresh after asynchronous actions.
25 -- Supplemental connectivity status must not create another Wi-Fi row model or write path.
27 -## Security
29 -- SSIDs and passphrases are passed as discrete process arguments, never interpolated into shell commands.
30 -- A passphrase exists only for the transient connect call.
31 -- Passphrases never enter state, action history, errors, diagnostics, or logs.
32 -- Brief passphrase visibility in process arguments for a new secured network is the accepted single-user tradeoff.
33 -- Live Wi-Fi mutation is performed only by the controlling user, never by build or test workers.
35 -## Interface constraints
37 -- Existing connectivity and self-test IPC remains available.
38 -- State retains Wi-Fi enabled state, compact signal, exact network identity, and the minimal shader state required by its consumer.
39 -- Missing or malformed replies produce safe empty state rather than exceptions.
41 -## Acceptance
43 -- Sanitized fixtures cover managed objects, ordered networks, decoded names, known state, refresh races, signal shaping, malformed replies, and diagnostics.
44 -- Runtime self-test passes.
45 -- Live controller verification confirms scan, toggle, known or open connection, password handling, and unchanged Bluetooth behavior.
46 -- Fixture-based build verification performs no live mutation.

.system/specs/NL-SPEC-F3E26F58-launcher-popup/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-F3E26F58
3 -type: spec
4 -title: Launcher popup
5 ----
7 -# Launcher popup
9 -## Behavior
11 -- The launcher presents one full-width result list without a duplicate preview or provider chips.
12 -- It searches applications, actions, calculator results, clipboard rows, and windows.
13 -- `=` selects calculator, `>` selects actions, and `clip ` selects clipboard.
14 -- An unprefixed query searches all providers.
15 -- Matching supports exact, prefix, word-boundary subsequence, loose subsequence, and substring results.
16 -- Stronger matches rank first.
17 -- Application rows show themed icons with a provider-glyph fallback; other providers use distinct glyphs.
18 -- Rows show title and concise lowercase verb and subtitle metadata.
19 -- Calculator results emphasize the computed value and copy it on activation.
20 -- Empty queries list applications in title order.
21 -- Up and down change selection; Enter activates the selected result.
23 -## Constraints
25 -- Calculator input accepts only the existing numeric operator grammar.
26 -- Rejected or non-finite expressions produce no result.
27 -- Usage records remain telemetry and do not affect ranking.
28 -- Missing window or clipboard data contributes no rows and does not fail the launcher.
29 -- Existing application, window, calculator, clipboard, and action routes retain their effects.
30 -- Existing launcher IPC remains available and stable.
31 -- Search responses expose functional state without view narration.
33 -## Acceptance
35 -- Pure checks prove prefix parsing, score ordering, subsequence matches, misses, calculator rejection, icons, provider filtering, and ranking.
36 -- Runtime self-test passes.
37 -- A live visual check confirms icons and fallbacks, all providers, calculator copying, and keyboard selection.
38 -- The launcher has no decorative bottom stripe.

.system/specs/NL-SPEC-FDA339B0-brightness-popup-and-ddc-setup/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-FDA339B0
3 -type: spec
4 -title: Brightness popup and DDC setup
5 ----
7 -# Brightness popup and DDC setup
9 -## Display behavior
11 -- Only detected displays are shown.
12 -- A built-in row exists only when a usable backlight device exists.
13 -- Connected external monitors appear before DDC capability is known.
14 -- With no controllable display, detected rows and one primary `setup ddc` action appear without fake values or sliders.
15 -- With controllable displays, the popup shows a global control, four quarter-step presets, and one control per display.
16 -- Equal display values produce one normal global fill.
17 -- Different values produce one contiguous stacked multislider without a `mixed` label.
18 -- Global drag and presets set every controllable display; per-display drag changes only that display.
19 -- Readiness is implied by controls; issue badges appear only on affected rows.
21 -## DDC setup behavior
23 -- Setup progresses through preflight, authorization, installation, detection, reading, verification, and ready stages.
24 -- Every expanded stage remains visibly waiting, running, done, or failed.
25 -- Authorization occurs only after explicit user action and only when package or current-session setup is incomplete.
26 -- Arch's `ddcutil` package owns persistent system integration.
27 -- Nuguland does not duplicate package-owned module or udev configuration.
28 -- Detection maps external connectors to I2C buses.
29 -- A display becomes controllable only after a successful brightness read.
30 -- Partial monitor failure leaves working monitors controllable.
31 -- Successful setup collapses to a reopenable `ddc ready` state.
32 -- Failures identify the stage and allow retry from that stage.
33 -- Duplicate submission is disabled while running.
34 -- Cancellation retains completed package-native changes and reports cancellation.
36 -## Safety and diagnostics
38 -- Privileged setup is initiated only by the user through Nuguland's authorization flow.
39 -- Captured output remains internal; exposed diagnostics are bounded and redacted.
40 -- Diagnostics exclude passwords, environment variables, and arbitrary command lines.
41 -- Detection, reads, and writes have explicit timeouts.
42 -- DDC writes run unprivileged against the detected bus.
43 -- Successful writes update the row and OSD.
44 -- Failed writes preserve the previous value and show an inline error.
45 -- Invalid levels are clamped to the supported range.
47 -## Interface constraints
49 -- Existing brightness, display, setup, and self-test IPC remains available.
50 -- State distinguishes display rows, global none, synced, or mixed state, setup stages, errors, and compact state without debug narration.
52 -## Acceptance
54 -- Pure tests cover levels, roles, display shaping, mixed and synced state, DDC parsing, stage transitions, partial failure, redaction, timeouts, cancellation, and argument shaping.
55 -- QML checks prove setup is observable, writes target detected buses, and privileged work is not detached or opaque.
56 -- Full tests and the zero-warning lint gate pass.
57 -- A visual check confirms no fake controls, the multislider, presets, display controls, stage feedback, and lowercase labels.

.system/specs/NL-SPEC-FEE98E07-event-driven-audio-state/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-FEE98E07
3 -type: spec
4 -title: Event-driven audio state
5 ----
7 -# Event-driven audio state
9 -## Outcome
11 -The shell reports audio, playback, and privacy facts without continuously capturing audio samples.
12 -Idle audio devices remain free to suspend.
14 -## Requirements
16 -- Output and input activity reflect active audio-graph links and mute state.
17 -- Playback activity reflects the active media player's playback state.
18 -- Volume and mute remain live, controllable properties.
19 -- Microphone and camera privacy indication retains its behavior.
20 -- The shell owns no continuous amplitude capture stream and performs no periodic level smoothing.
21 -- No state contract exposes amplitude levels or describes nonexistent peak capture.
22 -- Link presence is an acceptable activity proxy even when device suspension follows later.
24 -## Acceptance
26 -- An idle shell creates no peak-monitor capture node and causes no audio-level polling wakeup.
27 -- Media energy is `1` while playing and `0` while paused or stopped.
28 -- Audio controls, default-device selection, and mute controls work.
29 -- Microphone and camera indicators follow live use.
30 -- Audio and media state serialize without missing-property or load errors.
31 -- With no playback, the sink can become idle or suspended and sustained shell CPU remains below the former baseline.
33 -## Out of scope
35 -- Amplitude meters, waveforms, and VU displays.
36 -- Resource polling unrelated to audio.

AGENTS.md

Deleted
deleted file mode 100644
1 -# Dotfiles
3 -Dorkfiles repo.
4 -Run this file's commands from the dotfiles root, not a nested project directory.
5 -Preserve unrelated dirty work.
6 -Check `git status --short` before edits.
7 -Prefer repo paths (`pi/agent/...`) over `$HOME` paths.
8 -Use `mise` tasks; host bootstrap assumes Git + mise, then mise supplies Java.
9 -Root `mise.toml` tools are dorkfiles bootstrap deps only; other apps come from system/package manager.
10 -Root mise task shell is `scripts/mise_shell.java`, not Nushell/Bash.
11 -`mise run ci` also needs host Podman; its Fedora container installs Git/mise, then mise supplies Java.
12 -Never print decrypted secrets.
13 -Do not delete noisy research/cache/untracked files unless explicitly asked.
15 -## Secrets
17 -`.secrets` is plaintext.
18 -It lists repo-relative paths to encrypt.
20 -Encryption comes from local Git filter `dotfiles-aes` via tracked `.gitattributes`.
21 -`bootstripper` generates its managed block from `.secrets` and removes the obsolete block from `.git/info/attributes`.
23 -For non-interactive crypto bootstrap, env is `DOTFILES_AES_PASSPHRASE`; do not ask for or expose it unless user explicitly initiates setup.
25 -For a new secret:
27 -```sh
28 -$EDITOR .secrets
29 -java bootstripper.java check
30 -git add .secrets .gitattributes
31 -git check-attr -a -- path/to/secret
32 -```
34 -Required attrs:
36 -```text
37 -filter: dotfiles-aes
38 -text: unset
39 -diff: unset
40 -```
42 -A `.secrets` path must not be matched by any ignore rule; `check` fails, because `git add -A` would silently skip it.
44 -Do not `git add -A` new secret-looking files before this.
45 -For private keys, verify staged content is not plaintext:
47 -```sh
48 -git cat-file -p :path/to/key | LC_ALL=C grep -q 'BEGIN .*PRIVATE KEY' && exit 1
49 -```
51 -Important secret paths include `ssh/*.key`, `gh/hosts.yml`, `pi/agent/auth.json`, `nushell/secrets.nu`, app private settings.
53 -## Git operations in this repo
55 -`bootstripper.java` converges `rebase.autostash` and `merge.autostash` to `false` in `.git/config`; `mise run check` asserts it.
56 -So Git refuses to pull, rebase, or merge here while the worktree is dirty: commit first, or stash explicitly and pop it yourself.
57 -The required `dotfiles-aes` filter and the `pre-commit`/`pre-push` hooks (`bootstripper.java` → mise) can abort a Git operation midway; never pass `--no-verify` to get around them.
59 -## Symlink manifests
61 -Files like `desktop.symlinks`, `fedora.symlinks`, `termux.symlinks`, `NB-00718.symlinks` are source/target pairs:
63 -```text
64 -repo/path
65 -~/target/path
66 -```
68 -Blank lines separate pairs. Keep pairs ordered and complete. Hostname chooses `<host>.symlinks`.
69 -Managed symlinks must never point outside HOME; no `/usr`, `/etc`, or system target links. Treat outside-HOME symlinks as errors; do not relink/delete them.
71 -## Commands
73 -Safe checks:
75 -```sh
76 -mise run check
77 -mise run secrets-scan
78 -```
80 -Heavy integration:
82 -```sh
83 -mise run ci
84 -```
86 -Never run privileged/root/elevated commands.
87 -Give the user the shortest copyable one-line command in their preferred shell.
89 -HOME/system mutating; only run after explicit user request:
91 -```sh
92 -mise run link
93 -mise run clean
94 -```
96 -`link` validates manifests, converges crypto state, restores unchanged ciphertext, installs or repairs Git hooks, and creates symlinks; it never executes Gitleaks or fixes unrelated permissions.
97 -Crypto convergence is idempotent: a ready plaintext worktree does not rewrite secrets, keys, attributes, or Git config, and does not run routine AES self-tests.
98 -Commits and pushes require `gitleaks` on Git's `PATH`; missing Gitleaks blocks the Git operation, not linking.
99 -Git hooks validate only and never bootstrap crypto.
100 -`mise run setup-crypto` exposes the same crypto convergence independently.
101 -Restoration refuses staged changes, deletions, symlinks, changed ciphertext, or mixed ciphertext plus changed plaintext before writing any tracked secret.
103 -Crypto/hooks:
105 -```sh
106 -java bootstripper.java check
107 -java bootstripper.java pre-commit
108 -java bootstripper.java pre-push
109 -java bootstripper.java install-hooks
110 -java bootstripper.java init-crypto
111 -java bootstripper.java setup-crypto
112 -```
114 -## Global Mise config
116 -- User config source: `mise-config/` links to `~/.config/mise`.
118 -## Global Pi config
120 -- Settings: `pi/agent/settings.json`
121 -- Models: `pi/agent/models.json`
122 -- Extension sources: `pi-ext/extensions/`, loaded through the package configured in `pi/agent/settings.json`.
123 -- Modes: `pi/agent/modes/`
124 -- Personal skills: `pi/agent/skills/<name>/SKILL.md` or `pi/agent/skills/<name>.md`
125 -- `pi/agent/auth.json` is secret; avoid reading/editing unless explicitly asked.
127 -## Subprojects
129 -- Neovim: read `neovim/AGENTS.md` before changes; tests via `cd neovim && just test`.
130 -- Nugu: load `nugu` skill before palette/theme work.
131 -- Pi-specific changes: read Pi docs before editing extensions/settings/skills.

neovim/.system/plans/NL-PLAN-CEJPO_XF-deliver-pivi-native-neovim-integration/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-CEJPO_XF
3 -type: plan
4 -title: Deliver pivi native Neovim integration
5 -spec: NL-SPEC-GMWDCMJZ
6 -status: approved
7 ----
9 -# Deliver pivi native Neovim integration
11 -## Intent
13 -Deliver [NL-SPEC-GMWDCMJZ](../../specs/NL-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md) as vertical slices, each observable through Neovim surfaces.
14 -Evidence for transport, tool authority, and concurrency comes from [NL-RESEARCH-KZYYEFY_](../../research/NL-RESEARCH-KZYYEFY_-pi-and-neovim-capabilities-for-pivi/index.md).
16 -Placement: pivi is an ordinary configuration module at `lua/bugabinga/pivi/`, like the other Neovim modules, with its bundled Pi companion extension under `lua/bugabinga/pivi/extension/`.
17 -Module-level testing rules live in that directory's `AGENTS.md`.
18 -Publishing state through native variables and `User` events still holds, so other configuration consumes pivi without depending on its internals.
20 -## Module map
22 -```mermaid
23 -flowchart TB
24 - command["bugabinga.pivi.command"] --> session["bugabinga.pivi.session"]
25 - command --> help["bugabinga.pivi.help"]
26 - session --> rpc["bugabinga.pivi.rpc"]
27 - session --> status["bugabinga.pivi.status"]
28 - status --> publish["bugabinga.pivi.publish"]
29 - session --> transcript["bugabinga.pivi.transcript"]
30 - session --> context["bugabinga.pivi.context"]
31 - session --> dialog["bugabinga.pivi.dialog"]
32 - rpc --> extension["companion Pi extension"]
33 - extension --> edit["bugabinga.pivi.edit"]
34 - edit --> activity["bugabinga.pivi.activity"]
35 - activity --> follow["bugabinga.pivi.follow"]
36 - help --> rpc
37 -```
39 -| Module | Responsibility |
40 -| --- | --- |
41 -| `bugabinga.pivi.rpc` | Child process lifetime, strict LF JSONL framing, request correlation, deferral out of fast contexts |
42 -| `bugabinga.pivi.session` | Session identity, working directory, queue delivery, abort, resume, switch |
43 -| `bugabinga.pivi.status` | Cached semantic state; no RPC during status evaluation |
44 -| `bugabinga.pivi.publish` | `vim.g` state plus `User` autocmd events with payload data |
45 -| `bugabinga.pivi.transcript` | Prompt, transcript, and detail buffers |
46 -| `bugabinga.pivi.context` | Immutable submission snapshots and ambient editor state |
47 -| `bugabinga.pivi.edit` | Buffer-authoritative mutation, undo coherence, disk visibility |
48 -| `bugabinga.pivi.activity` | Extmarks, signs, virtual text, diagnostics, quickfix and location lists |
49 -| `bugabinga.pivi.follow` | Optional viewport following |
50 -| `bugabinga.pivi.dialog` | Extension UI requests mapped to `vim.ui` surfaces |
51 -| `bugabinga.pivi.help` | Ephemeral session-less run |
52 -| `bugabinga.pivi.command` | `:Pi` subcommands, slash-command entry, `<Plug>` mappings |
53 -| companion extension | Editor tools plus buffer-authoritative operations for built-in Pi tools |
55 -## Slice order
57 -```mermaid
58 -flowchart LR
59 - s1["1 Ask and stream"] --> s3["3 Status and events"]
60 - s1 --> s2["2 Ephemeral help"]
61 - s3 --> s4["4 Session control"]
62 - s4 --> s5["5 Submission context"]
63 - s5 --> s6["6 Buffer-authoritative reads"]
64 - s6 --> s7["7 Native edits"]
65 - s7 --> s8["8 Activity and lists"]
66 - s7 --> s9["9 Streaming ghost text"]
67 - s8 --> s10["10 Follow mode"]
68 - s4 --> s11["11 Slash commands"]
69 - s4 --> s12["12 Extension dialogs"]
70 -```
72 -| # | Observable behavior | Modules touched | Verified by |
73 -| --- | --- | --- | --- |
74 -| 1 | `:Pi ask {text}` starts Pi, streams assistant text into a transcript buffer, and survives partial reads | `bugabinga.pivi.rpc`, `bugabinga.pivi.session`, `bugabinga.pivi.transcript`, `bugabinga.pivi.command` | Framing and assembly specs plus a live round trip |
75 -| 2 | `:Pi help {q}` answers from an independent session-less run without touching any working session | `bugabinga.pivi.help`, `bugabinga.pivi.command` | Concurrent-run spec asserting untouched session history, queue, and status |
76 -| 3 | Status changes update cached state, emit semantic `User` events, and never issue RPC during evaluation | `bugabinga.pivi.status`, `bugabinga.pivi.publish` | Event payload spec plus a consumer that degrades when pivi is absent |
77 -| 4 | Create, resume, switch, stop sessions; queue steering or follow-up during a run; list, clear, abort | `bugabinga.pivi.session`, `bugabinga.pivi.command`, `bugabinga.pivi.transcript` | Queue state-machine spec matching the spec's run states |
78 -| 5 | Submissions carry immutable buffer, revision, cursor, range, and selection snapshots; queued items keep their own | `bugabinga.pivi.context`, `bugabinga.pivi.session` | Snapshot immutability spec under later buffer edits |
79 -| 6 | Pi reads unsaved loaded-buffer content and current core editor state on demand, including arbitrary Lua | companion extension, `bugabinga.pivi.rpc` | Tool-result spec comparing buffer versus disk content |
80 -| 7 | A normal Pi edit lands in a loaded buffer without reload, stays undoable as one change, and is visible to later shell work | `bugabinga.pivi.edit`, companion extension | Undo and coherence spec covering join failure fallback |
81 -| 8 | Edits leave a navigable trail; findings populate quickfix, location lists, and a distinct diagnostic namespace | `bugabinga.pivi.activity` | Namespace isolation and navigation spec |
82 -| 9 | Streaming tool arguments render ghost text that never mutates a buffer before arguments are complete | `bugabinga.pivi.activity`, `bugabinga.pivi.edit` | Partial-argument spec asserting zero mutation |
83 -| 10 | Follow mode tracks located events in a dedicated window or tab and restores the prior location | `bugabinga.pivi.follow` | Window ownership and restore spec |
84 -| 11 | `:Pi command ...` runs discovered Pi commands; `/` opens entry only at the first character of an input buffer | `bugabinga.pivi.command` | Cursor-position and discovery spec |
85 -| 12 | Extension dialogs and fire-and-forget status map to native surfaces and answer with matching identifiers | `bugabinga.pivi.dialog` | Request and response correlation spec |
87 -Slice 1 is the walking skeleton; every later slice keeps `just test` green before the next begins.
89 -## Critical paths
91 -- Child output arrives in fast contexts; all editor work defers through scheduling before API calls.
92 -- Submission during an active run always chooses steering or follow-up; rejection is never silent.
93 -- Help spawns its own session-less child so working-session history, queue, and status remain untouched.
94 -- Buffer authority prefers injecting operations into Pi's built-in tools over reimplementing them, because result and detail shapes must match exactly.
96 -## Risks
98 -| Risk | Slice | Mitigation |
99 -| --- | --- | --- |
100 -| Undo join refuses after undo or redo | 7 | Detect refusal and fall back to separate undo blocks rather than losing the edit |
101 -| Partial tool arguments are invalid JSON | 9 | Treat ghost text as presentation only; mutate solely on complete validated arguments |
102 -| Tool override breaks rendering or session state | 6, 7 | Keep built-in renderers and detail shapes; override behavior only |
103 -| Status consumers stall the statusline | 3 | Read cached state only |
104 -| Agent shell work reads stale disk content | 7 | Make agent buffer edits visible to filesystem readers as part of the edit behavior |

neovim/.system/plans/NL-PLAN-LAJ8PGRK-deliver-pivi-transcript-presentation-and-navigat/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-LAJ8PGRK
3 -type: plan
4 -title: Deliver pivi transcript presentation and navigation
5 -spec: NL-SPEC-GMWDCMJZ
6 -status: approved
7 -depends_on:
8 - - NL-PLAN-CEJPO_XF
9 ----
11 -# Deliver pivi transcript presentation and navigation
13 -## Intent
15 -Deliver the transcript presentation and navigation behavior of
16 -[NL-SPEC-GMWDCMJZ](../../specs/NL-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md).
18 -[NL-PLAN-CEJPO_XF](../NL-PLAN-CEJPO_XF-deliver-pivi-native-neovim-integration/index.md) delivered a working transcript that appends plain text and mixes pivi's own framing into the content.
19 -This plan makes the transcript the conversation document it already is: addressable entries, message text as authored, rendered formatting, and ordinary motion.
21 -Placement continues from the earlier plan: `lua/bugabinga/pivi/`, with module-level testing rules in that directory's `AGENTS.md`.
23 -Measured constraint, not assumption: a transcript that reparses on every streamed delta costs roughly five hundred times a transcript that lets redraw drive parsing.
24 -Presentation must therefore never force parsing per delta.
26 -## Module map
28 -```mermaid
29 -flowchart TB
30 - session["bugabinga.pivi.session"] --> entry["bugabinga.pivi.entry"]
31 - entry --> transcript["bugabinga.pivi.transcript"]
32 - transcript --> render["bugabinga.pivi.render"]
33 - entry --> fold["bugabinga.pivi.fold"]
34 - entry --> navigate["bugabinga.pivi.navigate"]
35 - navigate --> follow["bugabinga.pivi.follow"]
36 - navigate --> detail["bugabinga.pivi.detail"]
37 - command["bugabinga.pivi.command"] --> navigate
38 - command --> fold
39 -```
41 -| Module | Responsibility |
42 -| --- | --- |
43 -| `bugabinga.pivi.entry` | Entry identity, kind, bounds, metadata, and lifecycle over a transcript buffer |
44 -| `bugabinga.pivi.transcript` | Buffer ownership; message text only, with framing delegated to presentation |
45 -| `bugabinga.pivi.render` | Formatting, embedded language presentation, and framing decoration |
46 -| `bugabinga.pivi.fold` | Collapsed and expanded presentation of an entry |
47 -| `bugabinga.pivi.navigate` | Motion between entries and tool calls, and reaching a referenced location |
48 -| `bugabinga.pivi.detail` | Detailed inspection of one entry without leaving the transcript |
49 -| `bugabinga.pivi.session` | Emits entries instead of writing framing text |
50 -| `bugabinga.pivi.command` | `:Pi` subcommands and `<Plug>` mappings for the new behavior |
52 -## Slice order
54 -```mermaid
55 -flowchart LR
56 - s1["1 Addressable entries"] --> s2["2 Pure message text"]
57 - s1 --> s3["3 Collapse and expand"]
58 - s2 --> s4["4 Rendered formatting"]
59 - s1 --> s5["5 Motion between entries"]
60 - s5 --> s6["6 Reach a referenced location"]
61 - s3 --> s7["7 Detailed inspection"]
62 -```
64 -| # | Observable behavior | Modules touched | Verified by |
65 -| --- | --- | --- | --- |
66 -| 1 | Every appended submission, answer, tool call, result, and error is an addressable entry with stable bounds that survive later appends | `bugabinga.pivi.entry`, `bugabinga.pivi.transcript`, `bugabinga.pivi.session` | Entry bounds spec under streaming appends and buffer growth |
67 -| 2 | Transcript text is the message as authored; copying an answer yields the original text without framing | `bugabinga.pivi.transcript`, `bugabinga.pivi.render`, `bugabinga.pivi.session` | Copy spec comparing buffer text with recorded message content |
68 -| 3 | A tool result arrives collapsed to one readable line and expands on request; entry state never alters session history | `bugabinga.pivi.fold`, `bugabinga.pivi.entry`, `bugabinga.pivi.command` | Collapse spec asserting unchanged session entries and message state |
69 -| 4 | Message formatting renders rather than showing markup, embedded code appears in its own language, and unknown formats stay plain | `bugabinga.pivi.render` | Rendering spec plus a streaming budget assertion over a recorded answer |
70 -| 5 | Ordinary motions move between entries and between tool calls in both directions | `bugabinga.pivi.navigate`, `bugabinga.pivi.command` | Motion spec over a replayed recorded run |
71 -| 6 | An entry that names a location navigates there, reusing the existing follow surfaces | `bugabinga.pivi.navigate`, `bugabinga.pivi.follow` | Navigation spec asserting the working window is preserved |
72 -| 7 | An entry can be inspected in full, including tool arguments and results, without leaving the transcript | `bugabinga.pivi.detail`, `bugabinga.pivi.entry` | Inspection spec asserting the transcript window and cursor are unchanged |
74 -Slice 1 is the walking skeleton; every later slice keeps the whole suite green before the next begins.
76 -## Critical paths
78 -- Entry bounds must be extmark-backed, because text appended later shifts every fixed line number.
79 -- Presentation is driven by redraw, never by a forced parse per streamed delta.
80 -- Framing lives in decoration, so the buffer stays copyable message text.
81 -- Collapsing is presentation only; the session transcript and Pi history are untouched.
82 -- Location navigation reuses follow-mode surfaces rather than introducing a second window policy.
84 -## Risks
86 -| Risk | Slice | Mitigation |
87 -| --- | --- | --- |
88 -| Entry bounds drift as the transcript grows | 1 | Extmark-backed ranges, asserted after appends and after edits to earlier entries |
89 -| Moving framing out of the text loses scannability | 2 | Replace it with decoration in the same slice, and assert both text purity and visible framing |
90 -| Rendering cost grows with a long answer | 4 | Assert a streaming budget over a recorded answer; keep parsing redraw-driven |
91 -| Collapsed entries hide errors the user needs | 3 | Collapse voluminous results only; keep errors expanded |
92 -| New mappings collide with user keys | 3, 5, 7 | Buffer-local mappings in pivi buffers plus `<Plug>` mappings; no global keys |

neovim/.system/plans/NL-PLAN-T7XG71CC-deliver-pivi-tool-presentation/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-PLAN-T7XG71CC
3 -type: plan
4 -title: Deliver pivi tool presentation
5 -spec: NL-SPEC-GMWDCMJZ
6 -status: approved
7 -depends_on:
8 - - NL-PLAN-CEJPO_XF
9 - - NL-PLAN-LAJ8PGRK
10 ----
12 -# Deliver pivi tool presentation
14 -## Intent
16 -Make a tool call as legible in Neovim as it is in Pi's own interface, using native surfaces rather than a ported component tree.
18 -[NL-PLAN-LAJ8PGRK](../NL-PLAN-LAJ8PGRK-deliver-pivi-transcript-presentation-and-navigat/index.md) made every tool call an addressable, collapsible entry.
19 -That entry currently shows what a tool acted on and nothing about how it ended, and it discards everything a tool reports about its own work.
21 -Blocker: the behavior below is not yet in [NL-SPEC-GMWDCMJZ](../../specs/NL-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md).
22 -A tool presentation section and its acceptance criteria were drafted and await one-shot approval.
23 -This plan is not executable until that amendment lands.
25 -## Evidence
27 -Read from the installed Pi 0.85.1 implementation, not from prose.
28 -Tool results reach a client unchanged, so everything a tool reports is already on the wire and merely unused.
30 -| Tool | What it reports about its own work | When |
31 -| --- | --- | --- |
32 -| edit | a display diff, a unified patch, and the first changed line | always |
33 -| bash | progressive output, truncation, and a full output path | while running, throttled |
34 -| read | truncation | only when truncated |
35 -| grep, find, ls | truncation and the limit that was reached | only at a limit |
36 -| write | nothing | — |
38 -Neovim side: no diff parser ships, but diff syntax and the diff highlight groups do, and the theme already defines them.
40 -## Module map
42 -```mermaid
43 -flowchart TB
44 - session["bugabinga.pivi.session"] --> tool["bugabinga.pivi.tool"]
45 - tool --> entry["bugabinga.pivi.entry"]
46 - tool --> render["bugabinga.pivi.render"]
47 - render --> fold["bugabinga.pivi.fold"]
48 - tool --> diff["bugabinga.pivi.diff"]
49 - diff --> command["bugabinga.pivi.command"]
50 - tool --> navigate["bugabinga.pivi.navigate"]
51 -```
53 -| Module | Responsibility |
54 -| --- | --- |
55 -| `bugabinga.pivi.tool` | Interprets what a tool reports: outcome, change, progress, language, truncation |
56 -| `bugabinga.pivi.render` | Presents that interpretation as decoration inside the entry |
57 -| `bugabinga.pivi.diff` | Editor comparison of a completed change |
58 -| `bugabinga.pivi.fold` | Collapsed line that still states subject and outcome |
59 -| `bugabinga.pivi.navigate` | Reaching the first changed line rather than the file start |
60 -| `bugabinga.pivi.entry` | Carries the interpretation as entry metadata |
61 -| `bugabinga.pivi.session` | Feeds tool reports in, including while a tool still runs |
63 -## Slice order
65 -```mermaid
66 -flowchart LR
67 - s1["1 Outcome after the name"] --> s2["2 Change as a diff"]
68 - s1 --> s6["6 Truncation is reachable"]
69 - s2 --> s3["3 First changed line"]
70 - s2 --> s4["4 Editor comparison"]
71 - s1 --> s5["5 Output while running"]
72 - s5 --> s7["7 Output in its language"]
73 -```
75 -| # | Observable behavior | Modules touched | Verified by |
76 -| --- | --- | --- | --- |
77 -| 1 | A finished tool entry states how it ended beside what it acted on, and a collapsed entry keeps both | `bugabinga.pivi.tool`, `bugabinga.pivi.render`, `bugabinga.pivi.fold`, `bugabinga.pivi.session` | Outcome spec across edit, shell, search, and failure, plus a collapsed-line spec |
78 -| 2 | A completed edit shows its change with added and removed lines distinguished | `bugabinga.pivi.tool`, `bugabinga.pivi.render` | Diff presentation spec asserting distinct added and removed lines and unchanged buffer text |
79 -| 3 | Navigating from an edit lands on its first changed line | `bugabinga.pivi.navigate`, `bugabinga.pivi.tool` | Navigation spec over a recorded edit |
80 -| 4 | A change can be opened as a full editor comparison and left again | `bugabinga.pivi.diff`, `bugabinga.pivi.command` | Comparison spec asserting the working window survives and the transcript is unchanged |
81 -| 5 | Output of a running tool appears as it arrives rather than only at completion | `bugabinga.pivi.session`, `bugabinga.pivi.tool`, `bugabinga.pivi.entry` | Progressive-output spec asserting growth before completion and stable bounds |
82 -| 6 | A truncated result says so, and its full output is reachable | `bugabinga.pivi.tool`, `bugabinga.pivi.render`, `bugabinga.pivi.navigate` | Truncation spec asserting the notice and a reachable full output |
83 -| 7 | Output is presented in the language it came from when that language is known | `bugabinga.pivi.tool`, `bugabinga.pivi.render` | Language spec asserting a second language is parsed inside the transcript |
85 -Slice 1 is the walking skeleton: it establishes the interpretation every later slice reads.
87 -## Critical paths
89 -- Interpretation is derived only from what a tool reports; a tool that reports nothing degrades to today's behavior rather than to a guess.
90 -- Diff presentation is decoration over reported change text, so the transcript still yields message text when copied.
91 -- An editor comparison reconstructs the prior content from the reported change rather than re-reading a file that has already moved on.
92 -- Progressive output replaces the tail of its own entry; entry bounds stay extmark-backed and must survive repeated rewrites.
93 -- Presentation stays redraw-driven, so a tool that emits output continuously cannot force parsing per update.
95 -## Risks
97 -| Risk | Slice | Mitigation |
98 -| --- | --- | --- |
99 -| Tools differ in what they report | 1 | Interpretation is per tool with a plain fallback, asserted for a tool that reports nothing |
100 -| Diff decoration drifts from the text it marks | 2 | Anchor decoration to entry-relative rows and assert after later entries are appended |
101 -| A reconstructed comparison disagrees with the file on disk | 4 | Present it as a comparison of the recorded change, and state when the file has moved on |
102 -| Frequent progress updates cost too much | 5 | Rewrite only the entry tail, keep parsing redraw-driven, and hold the streaming budget spec |
103 -| A collapsed line grows unreadable | 1 | Bound subject and outcome, and assert a maximum collapsed width |

neovim/.system/plans/NVIM-PLAN-CEJPO_XF-deliver-pivi-native-neovim-integration/index.md

Added
new file mode 100644
1 +---
2 +id: NVIM-PLAN-CEJPO_XF
3 +type: plan
4 +title: Deliver pivi native Neovim integration
5 +spec: NVIM-SPEC-GMWDCMJZ
6 +status: approved
7 +---
9 +# Deliver pivi native Neovim integration
11 +## Intent
13 +Deliver [NVIM-SPEC-GMWDCMJZ](../../specs/NVIM-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md) as vertical slices, each observable through Neovim surfaces.
14 +Evidence for transport, tool authority, and concurrency comes from [NVIM-RESEARCH-KZYYEFY_](../../research/NVIM-RESEARCH-KZYYEFY_-pi-and-neovim-capabilities-for-pivi/index.md).
16 +Placement: pivi is an ordinary configuration module at `lua/bugabinga/pivi/`, like the other Neovim modules, with its bundled Pi companion extension under `lua/bugabinga/pivi/extension/`.
17 +Module-level testing rules live in that directory's `AGENTS.md`.
18 +Publishing state through native variables and `User` events still holds, so other configuration consumes pivi without depending on its internals.
20 +## Module map
22 +```mermaid
23 +flowchart TB
24 + command["bugabinga.pivi.command"] --> session["bugabinga.pivi.session"]
25 + command --> help["bugabinga.pivi.help"]
26 + session --> rpc["bugabinga.pivi.rpc"]
27 + session --> status["bugabinga.pivi.status"]
28 + status --> publish["bugabinga.pivi.publish"]
29 + session --> transcript["bugabinga.pivi.transcript"]
30 + session --> context["bugabinga.pivi.context"]
31 + session --> dialog["bugabinga.pivi.dialog"]
32 + rpc --> extension["companion Pi extension"]
33 + extension --> edit["bugabinga.pivi.edit"]
34 + edit --> activity["bugabinga.pivi.activity"]
35 + activity --> follow["bugabinga.pivi.follow"]
36 + help --> rpc
37 +```
39 +| Module | Responsibility |
40 +| --- | --- |
41 +| `bugabinga.pivi.rpc` | Child process lifetime, strict LF JSONL framing, request correlation, deferral out of fast contexts |
42 +| `bugabinga.pivi.session` | Session identity, working directory, queue delivery, abort, resume, switch |
43 +| `bugabinga.pivi.status` | Cached semantic state; no RPC during status evaluation |
44 +| `bugabinga.pivi.publish` | `vim.g` state plus `User` autocmd events with payload data |
45 +| `bugabinga.pivi.transcript` | Prompt, transcript, and detail buffers |
46 +| `bugabinga.pivi.context` | Immutable submission snapshots and ambient editor state |
47 +| `bugabinga.pivi.edit` | Buffer-authoritative mutation, undo coherence, disk visibility |
48 +| `bugabinga.pivi.activity` | Extmarks, signs, virtual text, diagnostics, quickfix and location lists |
49 +| `bugabinga.pivi.follow` | Optional viewport following |
50 +| `bugabinga.pivi.dialog` | Extension UI requests mapped to `vim.ui` surfaces |
51 +| `bugabinga.pivi.help` | Ephemeral session-less run |
52 +| `bugabinga.pivi.command` | `:Pi` subcommands, slash-command entry, `<Plug>` mappings |
53 +| companion extension | Editor tools plus buffer-authoritative operations for built-in Pi tools |
55 +## Slice order
57 +```mermaid
58 +flowchart LR
59 + s1["1 Ask and stream"] --> s3["3 Status and events"]
60 + s1 --> s2["2 Ephemeral help"]
61 + s3 --> s4["4 Session control"]
62 + s4 --> s5["5 Submission context"]
63 + s5 --> s6["6 Buffer-authoritative reads"]
64 + s6 --> s7["7 Native edits"]
65 + s7 --> s8["8 Activity and lists"]
66 + s7 --> s9["9 Streaming ghost text"]
67 + s8 --> s10["10 Follow mode"]
68 + s4 --> s11["11 Slash commands"]
69 + s4 --> s12["12 Extension dialogs"]
70 +```
72 +| # | Observable behavior | Modules touched | Verified by |
73 +| --- | --- | --- | --- |
74 +| 1 | `:Pi ask {text}` starts Pi, streams assistant text into a transcript buffer, and survives partial reads | `bugabinga.pivi.rpc`, `bugabinga.pivi.session`, `bugabinga.pivi.transcript`, `bugabinga.pivi.command` | Framing and assembly specs plus a live round trip |
75 +| 2 | `:Pi help {q}` answers from an independent session-less run without touching any working session | `bugabinga.pivi.help`, `bugabinga.pivi.command` | Concurrent-run spec asserting untouched session history, queue, and status |
76 +| 3 | Status changes update cached state, emit semantic `User` events, and never issue RPC during evaluation | `bugabinga.pivi.status`, `bugabinga.pivi.publish` | Event payload spec plus a consumer that degrades when pivi is absent |
77 +| 4 | Create, resume, switch, stop sessions; queue steering or follow-up during a run; list, clear, abort | `bugabinga.pivi.session`, `bugabinga.pivi.command`, `bugabinga.pivi.transcript` | Queue state-machine spec matching the spec's run states |
78 +| 5 | Submissions carry immutable buffer, revision, cursor, range, and selection snapshots; queued items keep their own | `bugabinga.pivi.context`, `bugabinga.pivi.session` | Snapshot immutability spec under later buffer edits |
79 +| 6 | Pi reads unsaved loaded-buffer content and current core editor state on demand, including arbitrary Lua | companion extension, `bugabinga.pivi.rpc` | Tool-result spec comparing buffer versus disk content |
80 +| 7 | A normal Pi edit lands in a loaded buffer without reload, stays undoable as one change, and is visible to later shell work | `bugabinga.pivi.edit`, companion extension | Undo and coherence spec covering join failure fallback |
81 +| 8 | Edits leave a navigable trail; findings populate quickfix, location lists, and a distinct diagnostic namespace | `bugabinga.pivi.activity` | Namespace isolation and navigation spec |
82 +| 9 | Streaming tool arguments render ghost text that never mutates a buffer before arguments are complete | `bugabinga.pivi.activity`, `bugabinga.pivi.edit` | Partial-argument spec asserting zero mutation |
83 +| 10 | Follow mode tracks located events in a dedicated window or tab and restores the prior location | `bugabinga.pivi.follow` | Window ownership and restore spec |
84 +| 11 | `:Pi command ...` runs discovered Pi commands; `/` opens entry only at the first character of an input buffer | `bugabinga.pivi.command` | Cursor-position and discovery spec |
85 +| 12 | Extension dialogs and fire-and-forget status map to native surfaces and answer with matching identifiers | `bugabinga.pivi.dialog` | Request and response correlation spec |
87 +Slice 1 is the walking skeleton; every later slice keeps `just test` green before the next begins.
89 +## Critical paths
91 +- Child output arrives in fast contexts; all editor work defers through scheduling before API calls.
92 +- Submission during an active run always chooses steering or follow-up; rejection is never silent.
93 +- Help spawns its own session-less child so working-session history, queue, and status remain untouched.
94 +- Buffer authority prefers injecting operations into Pi's built-in tools over reimplementing them, because result and detail shapes must match exactly.
96 +## Risks
98 +| Risk | Slice | Mitigation |
99 +| --- | --- | --- |
100 +| Undo join refuses after undo or redo | 7 | Detect refusal and fall back to separate undo blocks rather than losing the edit |
101 +| Partial tool arguments are invalid JSON | 9 | Treat ghost text as presentation only; mutate solely on complete validated arguments |
102 +| Tool override breaks rendering or session state | 6, 7 | Keep built-in renderers and detail shapes; override behavior only |
103 +| Status consumers stall the statusline | 3 | Read cached state only |
104 +| Agent shell work reads stale disk content | 7 | Make agent buffer edits visible to filesystem readers as part of the edit behavior |

neovim/.system/plans/NVIM-PLAN-LAJ8PGRK-deliver-pivi-transcript-presentation-and-navigat/index.md

Added
new file mode 100644
1 +---
2 +id: NVIM-PLAN-LAJ8PGRK
3 +type: plan
4 +title: Deliver pivi transcript presentation and navigation
5 +spec: NVIM-SPEC-GMWDCMJZ
6 +status: approved
7 +depends_on:
8 + - NVIM-PLAN-CEJPO_XF
9 +---
11 +# Deliver pivi transcript presentation and navigation
13 +## Intent
15 +Deliver the transcript presentation and navigation behavior of
16 +[NVIM-SPEC-GMWDCMJZ](../../specs/NVIM-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md).
18 +[NVIM-PLAN-CEJPO_XF](../NVIM-PLAN-CEJPO_XF-deliver-pivi-native-neovim-integration/index.md) delivered a working transcript that appends plain text and mixes pivi's own framing into the content.
19 +This plan makes the transcript the conversation document it already is: addressable entries, message text as authored, rendered formatting, and ordinary motion.
21 +Placement continues from the earlier plan: `lua/bugabinga/pivi/`, with module-level testing rules in that directory's `AGENTS.md`.
23 +Measured constraint, not assumption: a transcript that reparses on every streamed delta costs roughly five hundred times a transcript that lets redraw drive parsing.
24 +Presentation must therefore never force parsing per delta.
26 +## Module map
28 +```mermaid
29 +flowchart TB
30 + session["bugabinga.pivi.session"] --> entry["bugabinga.pivi.entry"]
31 + entry --> transcript["bugabinga.pivi.transcript"]
32 + transcript --> render["bugabinga.pivi.render"]
33 + entry --> fold["bugabinga.pivi.fold"]
34 + entry --> navigate["bugabinga.pivi.navigate"]
35 + navigate --> follow["bugabinga.pivi.follow"]
36 + navigate --> detail["bugabinga.pivi.detail"]
37 + command["bugabinga.pivi.command"] --> navigate
38 + command --> fold
39 +```
41 +| Module | Responsibility |
42 +| --- | --- |
43 +| `bugabinga.pivi.entry` | Entry identity, kind, bounds, metadata, and lifecycle over a transcript buffer |
44 +| `bugabinga.pivi.transcript` | Buffer ownership; message text only, with framing delegated to presentation |
45 +| `bugabinga.pivi.render` | Formatting, embedded language presentation, and framing decoration |
46 +| `bugabinga.pivi.fold` | Collapsed and expanded presentation of an entry |
47 +| `bugabinga.pivi.navigate` | Motion between entries and tool calls, and reaching a referenced location |
48 +| `bugabinga.pivi.detail` | Detailed inspection of one entry without leaving the transcript |
49 +| `bugabinga.pivi.session` | Emits entries instead of writing framing text |
50 +| `bugabinga.pivi.command` | `:Pi` subcommands and `<Plug>` mappings for the new behavior |
52 +## Slice order
54 +```mermaid
55 +flowchart LR
56 + s1["1 Addressable entries"] --> s2["2 Pure message text"]
57 + s1 --> s3["3 Collapse and expand"]
58 + s2 --> s4["4 Rendered formatting"]
59 + s1 --> s5["5 Motion between entries"]
60 + s5 --> s6["6 Reach a referenced location"]
61 + s3 --> s7["7 Detailed inspection"]
62 +```
64 +| # | Observable behavior | Modules touched | Verified by |
65 +| --- | --- | --- | --- |
66 +| 1 | Every appended submission, answer, tool call, result, and error is an addressable entry with stable bounds that survive later appends | `bugabinga.pivi.entry`, `bugabinga.pivi.transcript`, `bugabinga.pivi.session` | Entry bounds spec under streaming appends and buffer growth |
67 +| 2 | Transcript text is the message as authored; copying an answer yields the original text without framing | `bugabinga.pivi.transcript`, `bugabinga.pivi.render`, `bugabinga.pivi.session` | Copy spec comparing buffer text with recorded message content |
68 +| 3 | A tool result arrives collapsed to one readable line and expands on request; entry state never alters session history | `bugabinga.pivi.fold`, `bugabinga.pivi.entry`, `bugabinga.pivi.command` | Collapse spec asserting unchanged session entries and message state |
69 +| 4 | Message formatting renders rather than showing markup, embedded code appears in its own language, and unknown formats stay plain | `bugabinga.pivi.render` | Rendering spec plus a streaming budget assertion over a recorded answer |
70 +| 5 | Ordinary motions move between entries and between tool calls in both directions | `bugabinga.pivi.navigate`, `bugabinga.pivi.command` | Motion spec over a replayed recorded run |
71 +| 6 | An entry that names a location navigates there, reusing the existing follow surfaces | `bugabinga.pivi.navigate`, `bugabinga.pivi.follow` | Navigation spec asserting the working window is preserved |
72 +| 7 | An entry can be inspected in full, including tool arguments and results, without leaving the transcript | `bugabinga.pivi.detail`, `bugabinga.pivi.entry` | Inspection spec asserting the transcript window and cursor are unchanged |
74 +Slice 1 is the walking skeleton; every later slice keeps the whole suite green before the next begins.
76 +## Critical paths
78 +- Entry bounds must be extmark-backed, because text appended later shifts every fixed line number.
79 +- Presentation is driven by redraw, never by a forced parse per streamed delta.
80 +- Framing lives in decoration, so the buffer stays copyable message text.
81 +- Collapsing is presentation only; the session transcript and Pi history are untouched.
82 +- Location navigation reuses follow-mode surfaces rather than introducing a second window policy.
84 +## Risks
86 +| Risk | Slice | Mitigation |
87 +| --- | --- | --- |
88 +| Entry bounds drift as the transcript grows | 1 | Extmark-backed ranges, asserted after appends and after edits to earlier entries |
89 +| Moving framing out of the text loses scannability | 2 | Replace it with decoration in the same slice, and assert both text purity and visible framing |
90 +| Rendering cost grows with a long answer | 4 | Assert a streaming budget over a recorded answer; keep parsing redraw-driven |
91 +| Collapsed entries hide errors the user needs | 3 | Collapse voluminous results only; keep errors expanded |
92 +| New mappings collide with user keys | 3, 5, 7 | Buffer-local mappings in pivi buffers plus `<Plug>` mappings; no global keys |

neovim/.system/plans/NVIM-PLAN-T7XG71CC-deliver-pivi-tool-presentation/index.md

Added
new file mode 100644
1 +---
2 +id: NVIM-PLAN-T7XG71CC
3 +type: plan
4 +title: Deliver pivi tool presentation
5 +spec: NVIM-SPEC-GMWDCMJZ
6 +status: approved
7 +depends_on:
8 + - NVIM-PLAN-CEJPO_XF
9 + - NVIM-PLAN-LAJ8PGRK
10 +---
12 +# Deliver pivi tool presentation
14 +## Intent
16 +Make a tool call as legible in Neovim as it is in Pi's own interface, using native surfaces rather than a ported component tree.
18 +[NVIM-PLAN-LAJ8PGRK](../NVIM-PLAN-LAJ8PGRK-deliver-pivi-transcript-presentation-and-navigat/index.md) made every tool call an addressable, collapsible entry.
19 +That entry currently shows what a tool acted on and nothing about how it ended, and it discards everything a tool reports about its own work.
21 +Blocker: the behavior below is not yet in [NVIM-SPEC-GMWDCMJZ](../../specs/NVIM-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md).
22 +A tool presentation section and its acceptance criteria were drafted and await one-shot approval.
23 +This plan is not executable until that amendment lands.
25 +## Evidence
27 +Read from the installed Pi 0.85.1 implementation, not from prose.
28 +Tool results reach a client unchanged, so everything a tool reports is already on the wire and merely unused.
30 +| Tool | What it reports about its own work | When |
31 +| --- | --- | --- |
32 +| edit | a display diff, a unified patch, and the first changed line | always |
33 +| bash | progressive output, truncation, and a full output path | while running, throttled |
34 +| read | truncation | only when truncated |
35 +| grep, find, ls | truncation and the limit that was reached | only at a limit |
36 +| write | nothing | — |
38 +Neovim side: no diff parser ships, but diff syntax and the diff highlight groups do, and the theme already defines them.
40 +## Module map
42 +```mermaid
43 +flowchart TB
44 + session["bugabinga.pivi.session"] --> tool["bugabinga.pivi.tool"]
45 + tool --> entry["bugabinga.pivi.entry"]
46 + tool --> render["bugabinga.pivi.render"]
47 + render --> fold["bugabinga.pivi.fold"]
48 + tool --> diff["bugabinga.pivi.diff"]
49 + diff --> command["bugabinga.pivi.command"]
50 + tool --> navigate["bugabinga.pivi.navigate"]
51 +```
53 +| Module | Responsibility |
54 +| --- | --- |
55 +| `bugabinga.pivi.tool` | Interprets what a tool reports: outcome, change, progress, language, truncation |
56 +| `bugabinga.pivi.render` | Presents that interpretation as decoration inside the entry |
57 +| `bugabinga.pivi.diff` | Editor comparison of a completed change |
58 +| `bugabinga.pivi.fold` | Collapsed line that still states subject and outcome |
59 +| `bugabinga.pivi.navigate` | Reaching the first changed line rather than the file start |
60 +| `bugabinga.pivi.entry` | Carries the interpretation as entry metadata |
61 +| `bugabinga.pivi.session` | Feeds tool reports in, including while a tool still runs |
63 +## Slice order
65 +```mermaid
66 +flowchart LR
67 + s1["1 Outcome after the name"] --> s2["2 Change as a diff"]
68 + s1 --> s6["6 Truncation is reachable"]
69 + s2 --> s3["3 First changed line"]
70 + s2 --> s4["4 Editor comparison"]
71 + s1 --> s5["5 Output while running"]
72 + s5 --> s7["7 Output in its language"]
73 +```
75 +| # | Observable behavior | Modules touched | Verified by |
76 +| --- | --- | --- | --- |
77 +| 1 | A finished tool entry states how it ended beside what it acted on, and a collapsed entry keeps both | `bugabinga.pivi.tool`, `bugabinga.pivi.render`, `bugabinga.pivi.fold`, `bugabinga.pivi.session` | Outcome spec across edit, shell, search, and failure, plus a collapsed-line spec |
78 +| 2 | A completed edit shows its change with added and removed lines distinguished | `bugabinga.pivi.tool`, `bugabinga.pivi.render` | Diff presentation spec asserting distinct added and removed lines and unchanged buffer text |
79 +| 3 | Navigating from an edit lands on its first changed line | `bugabinga.pivi.navigate`, `bugabinga.pivi.tool` | Navigation spec over a recorded edit |
80 +| 4 | A change can be opened as a full editor comparison and left again | `bugabinga.pivi.diff`, `bugabinga.pivi.command` | Comparison spec asserting the working window survives and the transcript is unchanged |
81 +| 5 | Output of a running tool appears as it arrives rather than only at completion | `bugabinga.pivi.session`, `bugabinga.pivi.tool`, `bugabinga.pivi.entry` | Progressive-output spec asserting growth before completion and stable bounds |
82 +| 6 | A truncated result says so, and its full output is reachable | `bugabinga.pivi.tool`, `bugabinga.pivi.render`, `bugabinga.pivi.navigate` | Truncation spec asserting the notice and a reachable full output |
83 +| 7 | Output is presented in the language it came from when that language is known | `bugabinga.pivi.tool`, `bugabinga.pivi.render` | Language spec asserting a second language is parsed inside the transcript |
85 +Slice 1 is the walking skeleton: it establishes the interpretation every later slice reads.
87 +## Critical paths
89 +- Interpretation is derived only from what a tool reports; a tool that reports nothing degrades to today's behavior rather than to a guess.
90 +- Diff presentation is decoration over reported change text, so the transcript still yields message text when copied.
91 +- An editor comparison reconstructs the prior content from the reported change rather than re-reading a file that has already moved on.
92 +- Progressive output replaces the tail of its own entry; entry bounds stay extmark-backed and must survive repeated rewrites.
93 +- Presentation stays redraw-driven, so a tool that emits output continuously cannot force parsing per update.
95 +## Risks
97 +| Risk | Slice | Mitigation |
98 +| --- | --- | --- |
99 +| Tools differ in what they report | 1 | Interpretation is per tool with a plain fallback, asserted for a tool that reports nothing |
100 +| Diff decoration drifts from the text it marks | 2 | Anchor decoration to entry-relative rows and assert after later entries are appended |
101 +| A reconstructed comparison disagrees with the file on disk | 4 | Present it as a comparison of the recorded change, and state when the file has moved on |
102 +| Frequent progress updates cost too much | 5 | Rewrite only the entry tail, keep parsing redraw-driven, and hold the streaming budget spec |
103 +| A collapsed line grows unreadable | 1 | Bound subject and outcome, and assert a maximum collapsed width |

neovim/.system/research/NL-RESEARCH-KZYYEFY_-pi-and-neovim-capabilities-for-pivi/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-RESEARCH-KZYYEFY_
3 -type: research
4 -title: Pi and Neovim capabilities for pivi
5 ----
7 -# Pi and Neovim capabilities for pivi
9 -## Sources
11 -Installed documentation only; no remembered API behavior.
13 -| Source | Version | Location |
14 -| --- | --- | --- |
15 -| Pi docs (`rpc.md`, `extensions.md`, `usage.md`, `sessions.md`, `json.md`) | 0.85.1 | `$PI_CONTEXT_DOCS_PATH` |
16 -| Neovim runtime docs (`api.txt`, `lua.txt`, `undo.txt`, `editing.txt`, `options.txt`) | 0.12.5 | `$VIMRUNTIME/doc` |
18 -## Pi facts
20 -### Transport
22 -- `pi --mode rpc` speaks JSON commands on stdin, responses and events on stdout.
23 -- Strict JSONL, LF only; clients strip a trailing `\r`; Unicode separators must not split records.
24 -- Optional `id` on commands correlates responses; most events carry no `id`.
25 -- Startup flags relevant to a client: `--provider`, `--model`, `--name`, `--session <path|id>`, `--session-dir`, `--no-session`, `-e <ext>`, `--tools`, `--append-system-prompt`.
27 -### Commands that map to pivi surfaces
29 -| pivi need | RPC command | Notes |
30 -| --- | --- | --- |
31 -| Submit prompt | `prompt` | During streaming requires `streamingBehavior: steer \| followUp`, else error |
32 -| Queue while running | `steer`, `follow_up`, `clear_queue` | Extension commands rejected here |
33 -| Stop | `abort`, `abort_retry`, `abort_bash` | `abort` waits for idle |
34 -| Status | `get_state`, `get_session_stats` | Model, thinking, streaming, queue, context usage |
35 -| Transcript | `get_messages`, `get_entries`, `get_tree` | `get_entries since` is a durable cursor; `leafId` detects branch moves |
36 -| Sessions | `new_session`, `switch_session`, `fork`, `clone`, `set_session_name` | Switch/fork cancellable by extensions |
37 -| Slash commands | `get_commands` | Returns extension, prompt-template, and skill commands; invoked as `/name` through `prompt` |
38 -| Model/thinking | `set_model`, `cycle_model`, `get_available_models`, `set_thinking_level`, `get_available_thinking_levels` | |
39 -| Compaction | `compact`, `set_auto_compaction` | |
41 -Built-in TUI commands such as `/settings` and `/hotkeys` are absent from `get_commands` and do not execute over RPC.
43 -### Concurrency semantics
45 -```mermaid
46 -stateDiagram-v2
47 - [*] --> Idle
48 - Idle --> Streaming: prompt
49 - Streaming --> Streaming: steer / follow_up queued
50 - Streaming --> Streaming: extension command executes immediately
51 - Streaming --> Idle: agent_settled
52 - Streaming --> Idle: abort
53 -```
55 -- A plain `prompt` while streaming is rejected without `streamingBehavior`.
56 -- An extension command (`/name`) sent through `prompt` executes immediately even during streaming and manages its own LLM interaction.
57 -- `agent_end` marks one low-level run; `agent_settled` marks full settlement after retry, compaction, and queued continuations.
58 -- Therefore a truly ephemeral question that never enters session history needs either an extension command or a separate process (`pi -p` / `pi --mode json` / a second `--mode rpc --no-session` child).
60 -### Events
62 -Streamed as JSONL: `agent_start`, `agent_end`, `agent_settled`, `turn_start`, `turn_end`, `message_start`, `message_update`, `message_end`, `tool_execution_start|update|end`, `bash_execution_update`, `queue_update`, `compaction_start|end`, `auto_retry_start|end`, `summarization_retry_*`, `extension_error`.
64 -- `message_update` carries only deltas; clients assemble partial state by `contentIndex`; `message_end.message` is authoritative.
65 -- Tool-call streaming exposes `toolcall_start` (`id`, `toolName`), `toolcall_delta` (argument chunks), `toolcall_end` (complete call). This is the only source for progressive edit intent, and argument chunks are partial JSON text.
66 -- `tool_execution_update.partialResult` is cumulative, not a delta.
68 -### Extension UI over RPC
70 -| Method | RPC behavior |
71 -| --- | --- |
72 -| `select`, `confirm`, `input`, `editor` | Request/response sub-protocol with matching `id`; optional `timeout` auto-resolves agent-side |
73 -| `notify`, `setStatus`, `setWidget`, `setTitle`, `set_editor_text` | Fire-and-forget requests |
74 -| `custom` | Returns `undefined` |
75 -| `setWorkingMessage`, `setWorkingIndicator`, `setFooter`, `setHeader`, `setEditorComponent`, `setToolsExpanded` | No-ops |
76 -| `getEditorText`, `getToolsExpanded`, theme getters/setters | Degraded or empty |
78 -`ctx.mode === "rpc"` and `ctx.hasUI === true`; TUI-only capability must be guarded on `ctx.mode === "tui"`.
80 -### Extension hooks a companion extension can use
82 -- `pi.registerTool` at load or at runtime; new tools are callable without `/reload`.
83 -- Built-in tools `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, `ls` can be overridden by registering the same name; result and `details` shapes must match exactly; omitted renderers fall back to built-ins; `promptSnippet`/`promptGuidelines` are not inherited.
84 -- Built-in tools also accept pluggable operations (`ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, …) via `createReadTool` and siblings, plus a `spawnHook` for shell tools. This delegates I/O without reimplementing tool semantics.
85 -- `tool_call` can mutate arguments or block; `tool_result` can post-process.
86 -- `input` event sees raw text with `source` of `interactive | rpc | extension` and can `continue`, `transform`, or `handled`.
87 -- `before_agent_start` exposes and can extend `systemPrompt` and structured `systemPromptOptions`.
88 -- `pi.registerCommand` supports `getArgumentCompletions`; `pi.getCommands` mirrors `get_commands`.
89 -- Tool output must be truncated; built-in limits are 50KB and 2000 lines.
91 -## Neovim facts
93 -### Transport
95 -- `vim.system(cmd, { stdin = true, stdout = fun(err, data), stderr = fun(err, data) })` gives streaming callbacks plus `SystemObj:write(data)` and `obj:write(nil)` to close stdin; `obj:kill()` stops the child.
96 -- Output callbacks run in fast contexts; API calls must be deferred through `vim.schedule` (`api-fast`, `vim.in_fast_event()`).
97 -- `jobstart`/`nvim_chan_send` remain the alternative channel API.
99 -### Buffers and edits
101 -| Need | Mechanism | Caveat |
102 -| --- | --- | --- |
103 -| Precise edit | `nvim_buf_set_text`, `nvim_buf_set_lines` | Each call opens a new undo block |
104 -| One undoable change | `:undojoin` before the next change | `E790` after undo/redo; must not be used blindly |
105 -| Change detection | `nvim_buf_attach` `on_lines`, `b:changedtick` | Callbacks are fast-context |
106 -| Diffing model output against buffer | `vim.text.diff` with `result_type = 'indices'` | Available in 0.12 |
107 -| Disk coherence after buffer edits | buffer write plus `:checktime`; `'autoread'` defaults on | Unwritten buffers stay invisible to filesystem tools |
109 -### Presentation
111 -- Extmarks provide `virt_text` with `virt_text_pos = "inline"` for ghost text, `virt_lines` (with `virt_lines_above`, `virt_lines_overflow`), highlights, and signs.
112 -- `nvim_set_decoration_provider` with `ephemeral` marks renders per redraw without persistent state.
113 -- `vim.diagnostic` namespaces keep agent findings separate from LSP and compiler diagnostics.
114 -- Quickfix and location lists use `setqflist`/`setloclist` and normal navigation.
116 -### Integration surface
118 -- `nvim_exec_autocmds` emits `User` events with a `data` payload (`event-data`), which fits publishing cached pivi state.
119 -- `nvim_create_user_command` supplies subcommands, `nargs`, and custom completion for `:Pi help` and `:Pi command ...`.
120 -- `<Plug>` mappings expose behavior without claiming global keys.
121 -- `vim.ui.select` and `vim.ui.input` can back RPC dialog methods.
123 -## Spec claims versus evidence
125 -| Spec claim | Support | Risk |
126 -| --- | --- | --- |
127 -| Non-terminal JSONL subprocess channel | `pi --mode rpc` plus `vim.system` stdin/stdout | Low |
128 -| Semantic status (queue, run, tool, retry, compaction) | `get_state`, `get_session_stats`, event stream | Low |
129 -| Slash commands via `:Pi command ...` | `get_commands` plus `prompt` with `/name` | Low; TUI-only commands unavailable |
130 -| `:Pi help` runnable during an active run | Extension command executes during streaming, or a separate ephemeral process | Medium; not ephemeral if routed through the working session |
131 -| Loaded buffers authoritative for reads and edits | Built-in tool override or injected `ReadOperations`/`EditOperations`/`WriteOperations` | Medium; result and `details` shapes must match exactly |
132 -| Progressive ghost text from streaming tool arguments | `toolcall_delta` plus inline `virt_text` | Medium; requires tolerant partial-JSON parsing |
133 -| One coherent undoable change per edit | `nvim_buf_set_text` plus `:undojoin` | Medium; `E790` and multi-hunk edits |
134 -| Edits visible to later shell work without watchers | Explicit buffer write plus `:checktime` | Medium; unwritten buffers diverge from disk |
135 -| Extension dialogs mapped to native surfaces | `extension_ui_request`/`extension_ui_response` | Low |
136 -| Multiple sessions, resume, switch | `--session`, `switch_session`, `new_session`, `fork`, `clone` | Low |
138 -## Open questions
140 -- Does `:Pi help` use a second short-lived Pi process, or a companion extension command inside the working session that suppresses history?
141 -- Can two Pi processes safely target one session file, or must ephemeral help always run with `--no-session`?
142 -- Is buffer authority better implemented as operations injection into built-in tools than as full tool overrides, given the exact `details` shape requirement?
143 -- How should partial `toolcall_delta` arguments be parsed safely enough to show ghost text without ever mutating a buffer?
144 -- When must pivi write a modified buffer to disk so that agent shell commands observe agent edits?

neovim/.system/research/NVIM-RESEARCH-KZYYEFY_-pi-and-neovim-capabilities-for-pivi/index.md

Added
new file mode 100644
1 +---
2 +id: NVIM-RESEARCH-KZYYEFY_
3 +type: research
4 +title: Pi and Neovim capabilities for pivi
5 +---
7 +# Pi and Neovim capabilities for pivi
9 +## Sources
11 +Installed documentation only; no remembered API behavior.
13 +| Source | Version | Location |
14 +| --- | --- | --- |
15 +| Pi docs (`rpc.md`, `extensions.md`, `usage.md`, `sessions.md`, `json.md`) | 0.85.1 | `$PI_CONTEXT_DOCS_PATH` |
16 +| Neovim runtime docs (`api.txt`, `lua.txt`, `undo.txt`, `editing.txt`, `options.txt`) | 0.12.5 | `$VIMRUNTIME/doc` |
18 +## Pi facts
20 +### Transport
22 +- `pi --mode rpc` speaks JSON commands on stdin, responses and events on stdout.
23 +- Strict JSONL, LF only; clients strip a trailing `\r`; Unicode separators must not split records.
24 +- Optional `id` on commands correlates responses; most events carry no `id`.
25 +- Startup flags relevant to a client: `--provider`, `--model`, `--name`, `--session <path|id>`, `--session-dir`, `--no-session`, `-e <ext>`, `--tools`, `--append-system-prompt`.
27 +### Commands that map to pivi surfaces
29 +| pivi need | RPC command | Notes |
30 +| --- | --- | --- |
31 +| Submit prompt | `prompt` | During streaming requires `streamingBehavior: steer \| followUp`, else error |
32 +| Queue while running | `steer`, `follow_up`, `clear_queue` | Extension commands rejected here |
33 +| Stop | `abort`, `abort_retry`, `abort_bash` | `abort` waits for idle |
34 +| Status | `get_state`, `get_session_stats` | Model, thinking, streaming, queue, context usage |
35 +| Transcript | `get_messages`, `get_entries`, `get_tree` | `get_entries since` is a durable cursor; `leafId` detects branch moves |
36 +| Sessions | `new_session`, `switch_session`, `fork`, `clone`, `set_session_name` | Switch/fork cancellable by extensions |
37 +| Slash commands | `get_commands` | Returns extension, prompt-template, and skill commands; invoked as `/name` through `prompt` |
38 +| Model/thinking | `set_model`, `cycle_model`, `get_available_models`, `set_thinking_level`, `get_available_thinking_levels` | |
39 +| Compaction | `compact`, `set_auto_compaction` | |
41 +Built-in TUI commands such as `/settings` and `/hotkeys` are absent from `get_commands` and do not execute over RPC.
43 +### Concurrency semantics
45 +```mermaid
46 +stateDiagram-v2
47 + [*] --> Idle
48 + Idle --> Streaming: prompt
49 + Streaming --> Streaming: steer / follow_up queued
50 + Streaming --> Streaming: extension command executes immediately
51 + Streaming --> Idle: agent_settled
52 + Streaming --> Idle: abort
53 +```
55 +- A plain `prompt` while streaming is rejected without `streamingBehavior`.
56 +- An extension command (`/name`) sent through `prompt` executes immediately even during streaming and manages its own LLM interaction.
57 +- `agent_end` marks one low-level run; `agent_settled` marks full settlement after retry, compaction, and queued continuations.
58 +- Therefore a truly ephemeral question that never enters session history needs either an extension command or a separate process (`pi -p` / `pi --mode json` / a second `--mode rpc --no-session` child).
60 +### Events
62 +Streamed as JSONL: `agent_start`, `agent_end`, `agent_settled`, `turn_start`, `turn_end`, `message_start`, `message_update`, `message_end`, `tool_execution_start|update|end`, `bash_execution_update`, `queue_update`, `compaction_start|end`, `auto_retry_start|end`, `summarization_retry_*`, `extension_error`.
64 +- `message_update` carries only deltas; clients assemble partial state by `contentIndex`; `message_end.message` is authoritative.
65 +- Tool-call streaming exposes `toolcall_start` (`id`, `toolName`), `toolcall_delta` (argument chunks), `toolcall_end` (complete call). This is the only source for progressive edit intent, and argument chunks are partial JSON text.
66 +- `tool_execution_update.partialResult` is cumulative, not a delta.
68 +### Extension UI over RPC
70 +| Method | RPC behavior |
71 +| --- | --- |
72 +| `select`, `confirm`, `input`, `editor` | Request/response sub-protocol with matching `id`; optional `timeout` auto-resolves agent-side |
73 +| `notify`, `setStatus`, `setWidget`, `setTitle`, `set_editor_text` | Fire-and-forget requests |
74 +| `custom` | Returns `undefined` |
75 +| `setWorkingMessage`, `setWorkingIndicator`, `setFooter`, `setHeader`, `setEditorComponent`, `setToolsExpanded` | No-ops |
76 +| `getEditorText`, `getToolsExpanded`, theme getters/setters | Degraded or empty |
78 +`ctx.mode === "rpc"` and `ctx.hasUI === true`; TUI-only capability must be guarded on `ctx.mode === "tui"`.
80 +### Extension hooks a companion extension can use
82 +- `pi.registerTool` at load or at runtime; new tools are callable without `/reload`.
83 +- Built-in tools `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, `ls` can be overridden by registering the same name; result and `details` shapes must match exactly; omitted renderers fall back to built-ins; `promptSnippet`/`promptGuidelines` are not inherited.
84 +- Built-in tools also accept pluggable operations (`ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, …) via `createReadTool` and siblings, plus a `spawnHook` for shell tools. This delegates I/O without reimplementing tool semantics.
85 +- `tool_call` can mutate arguments or block; `tool_result` can post-process.
86 +- `input` event sees raw text with `source` of `interactive | rpc | extension` and can `continue`, `transform`, or `handled`.
87 +- `before_agent_start` exposes and can extend `systemPrompt` and structured `systemPromptOptions`.
88 +- `pi.registerCommand` supports `getArgumentCompletions`; `pi.getCommands` mirrors `get_commands`.
89 +- Tool output must be truncated; built-in limits are 50KB and 2000 lines.
91 +## Neovim facts
93 +### Transport
95 +- `vim.system(cmd, { stdin = true, stdout = fun(err, data), stderr = fun(err, data) })` gives streaming callbacks plus `SystemObj:write(data)` and `obj:write(nil)` to close stdin; `obj:kill()` stops the child.
96 +- Output callbacks run in fast contexts; API calls must be deferred through `vim.schedule` (`api-fast`, `vim.in_fast_event()`).
97 +- `jobstart`/`nvim_chan_send` remain the alternative channel API.
99 +### Buffers and edits
101 +| Need | Mechanism | Caveat |
102 +| --- | --- | --- |
103 +| Precise edit | `nvim_buf_set_text`, `nvim_buf_set_lines` | Each call opens a new undo block |
104 +| One undoable change | `:undojoin` before the next change | `E790` after undo/redo; must not be used blindly |
105 +| Change detection | `nvim_buf_attach` `on_lines`, `b:changedtick` | Callbacks are fast-context |
106 +| Diffing model output against buffer | `vim.text.diff` with `result_type = 'indices'` | Available in 0.12 |
107 +| Disk coherence after buffer edits | buffer write plus `:checktime`; `'autoread'` defaults on | Unwritten buffers stay invisible to filesystem tools |
109 +### Presentation
111 +- Extmarks provide `virt_text` with `virt_text_pos = "inline"` for ghost text, `virt_lines` (with `virt_lines_above`, `virt_lines_overflow`), highlights, and signs.
112 +- `nvim_set_decoration_provider` with `ephemeral` marks renders per redraw without persistent state.
113 +- `vim.diagnostic` namespaces keep agent findings separate from LSP and compiler diagnostics.
114 +- Quickfix and location lists use `setqflist`/`setloclist` and normal navigation.
116 +### Integration surface
118 +- `nvim_exec_autocmds` emits `User` events with a `data` payload (`event-data`), which fits publishing cached pivi state.
119 +- `nvim_create_user_command` supplies subcommands, `nargs`, and custom completion for `:Pi help` and `:Pi command ...`.
120 +- `<Plug>` mappings expose behavior without claiming global keys.
121 +- `vim.ui.select` and `vim.ui.input` can back RPC dialog methods.
123 +## Spec claims versus evidence
125 +| Spec claim | Support | Risk |
126 +| --- | --- | --- |
127 +| Non-terminal JSONL subprocess channel | `pi --mode rpc` plus `vim.system` stdin/stdout | Low |
128 +| Semantic status (queue, run, tool, retry, compaction) | `get_state`, `get_session_stats`, event stream | Low |
129 +| Slash commands via `:Pi command ...` | `get_commands` plus `prompt` with `/name` | Low; TUI-only commands unavailable |
130 +| `:Pi help` runnable during an active run | Extension command executes during streaming, or a separate ephemeral process | Medium; not ephemeral if routed through the working session |
131 +| Loaded buffers authoritative for reads and edits | Built-in tool override or injected `ReadOperations`/`EditOperations`/`WriteOperations` | Medium; result and `details` shapes must match exactly |
132 +| Progressive ghost text from streaming tool arguments | `toolcall_delta` plus inline `virt_text` | Medium; requires tolerant partial-JSON parsing |
133 +| One coherent undoable change per edit | `nvim_buf_set_text` plus `:undojoin` | Medium; `E790` and multi-hunk edits |
134 +| Edits visible to later shell work without watchers | Explicit buffer write plus `:checktime` | Medium; unwritten buffers diverge from disk |
135 +| Extension dialogs mapped to native surfaces | `extension_ui_request`/`extension_ui_response` | Low |
136 +| Multiple sessions, resume, switch | `--session`, `switch_session`, `new_session`, `fork`, `clone` | Low |
138 +## Open questions
140 +- Does `:Pi help` use a second short-lived Pi process, or a companion extension command inside the working session that suppresses history?
141 +- Can two Pi processes safely target one session file, or must ephemeral help always run with `--no-session`?
142 +- Is buffer authority better implemented as operations injection into built-in tools than as full tool overrides, given the exact `details` shape requirement?
143 +- How should partial `toolcall_delta` arguments be parsed safely enough to show ghost text without ever mutating a buffer?
144 +- When must pivi write a modified buffer to disk so that agent shell commands observe agent edits?

neovim/.system/specs/NL-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md

Deleted
deleted file mode 100644
1 ----
2 -id: NL-SPEC-GMWDCMJZ
3 -type: spec
4 -title: pivi Native Neovim Integration
5 -research:
6 - - NL-RESEARCH-KZYYEFY_
7 ----
9 -# pivi Native Neovim Integration
11 -## Intent
13 -pivi makes Pi feel native inside Neovim rather than embedding Pi's terminal interface.
14 -Pi remains a fully empowered coding agent.
15 -Neovim supplies editing, navigation, presentation, and live editor context.
17 -[Accepted native edit and follow-mode mockup](./native-agent-trail.html)
19 -## Scope
21 -pivi provides:
23 -- Persistent Pi sessions controlled through Pi RPC.
24 -- Neovim buffers for prompts, transcripts, session navigation, and detailed output.
25 -- Native quickfix lists, location lists, diagnostics, extmarks, signs, diffs, and navigation.
26 -- Live access to core Neovim state and unrestricted Neovim Lua execution.
27 -- A bundled Pi companion extension loaded in addition to the user's normal Pi configuration.
29 -Initial editor tools focus on buffers, selections, windows, tabs, marks, jumps, changes, lists, diagnostics, commands, and Lua execution.
30 -LSP-specific tools are outside the initial scope.
32 -## Session behavior
34 -- A Pi session is an explicit task identity with persistent history.
35 -- Each session captures a working directory as its execution scope.
36 -- Multiple sessions may share one working directory.
37 -- A tab may select a default session but does not own its lifetime.
38 -- Source buffers do not own sessions.
39 -- Closing a session window hides presentation without deleting history or implicitly stopping Pi.
40 -- While a session run is active, a new submission is queued with an explicit delivery choice and is never silently dropped.
41 -- Queued submissions remain listable and clearable before delivery.
43 -```mermaid
44 -stateDiagram-v2
45 - [*] --> Idle
46 - Idle --> Running: submit
47 - Running --> Running: queue steering or follow-up
48 - Running --> Idle: settle
49 - Running --> Idle: abort
50 - Idle --> [*]: stop session
51 -```
53 -## Slash commands
55 -- Pi slash commands are available through `:Pi command ...`.
56 -- Only commands Pi exposes to non-interactive clients are offered; terminal-only commands are absent.
57 -- In a Pi input buffer, `/` invokes slash-command entry only when the cursor is at the first character.
58 -- Elsewhere, `/` retains ordinary Neovim behavior.
60 -## One-shot help
62 -- `:Pi help` answers a fast question about Neovim, pivi, or Pi.
63 -- Help runs as an independent ephemeral agent run with no persisted session and no shared history.
64 -- Help never enters a working session's transcript, queue, or status.
65 -- Help stays available while a working session runs, and neither delays nor interrupts it.
66 -- Help failure is isolated and never degrades a working session.
67 -- Help may read, and never modifies the editor, the filesystem, or Pi state.
68 -- Each question carries what the user can currently see rather than whole buffers.
69 -- Editor documentation is answered from the running instance, so the version and installed plugins decide the answer.
70 -- pivi's own behavior is supplied as knowledge to the agent rather than assumed.
72 -```mermaid
73 -flowchart LR
74 - editor["Neovim"] --> session["Working session run"]
75 - editor --> help["Ephemeral help run"]
76 - session --> history["Persistent session history"]
77 - help --> discard["Discarded after answer"]
78 - help --> readonly["Read-only editor and documentation lookups"]
79 -```
81 -## Editor context
83 -- Each submission may carry an immutable snapshot of its originating buffer, path, revision, cursor, range, selection kind, selected text, and bounded surrounding text.
84 -- Queued submissions retain their own snapshots.
85 -- Pi can obtain fresh ambient editor state before later model calls.
86 -- Full buffer contents are fetched on demand rather than attaching every open buffer automatically.
87 -- Loaded buffers, including unsaved contents, are authoritative for editor-aware reads.
88 -- The Pi prompt receives a short stable orientation to the live Neovim environment without replacing existing system or project instructions.
90 -## Editing
92 -- Pi may edit without an approval gate.
93 -- Reads, edits, and writes preserve the behavior and improvements of Pi's upstream tools while making loaded Neovim buffers authoritative.
94 -- Agent changes to loaded buffers appear directly in Neovim, remain undoable, and become visible to filesystem-based commands without requiring manual reload.
95 -- Unloaded paths retain normal Pi filesystem behavior.
96 -- Validated edit intent may appear progressively as ghost text while tool arguments stream.
97 -- Real buffer mutation begins only after complete valid edit arguments exist.
98 -- An edit operation presents one coherent undoable change where Neovim permits it.
99 -- pivi uses no filesystem watchers.
100 -- Arbitrary shell or third-party tool mutations without identified paths are not represented as precise editor edits.
102 -## Transcript presentation
104 -A transcript is the conversation itself, presented as the document it already is.
106 -- Transcript text is the messages as authored; pivi's own framing is presentation rather than content.
107 -- Copying transcript text yields the original message text, without framing.
108 -- Message formatting is rendered rather than shown as markup, and embedded code is presented in its own language.
109 -- Rendering degrades to plain readable text when a format cannot be rendered.
110 -- Presentation never performs Pi RPC, and streaming stays responsive as a transcript grows.
112 -## Transcript navigation
114 -Every transcript entry is an addressable unit: a submission, an answer, a tool call, a tool result, or an error.
116 -- An entry can be collapsed to a single readable line or expanded to its full content.
117 -- Voluminous entries, such as tool results, start collapsed.
118 -- The user can move between entries, and between tool calls, with ordinary motions.
119 -- An entry that names a location is navigable to that location.
120 -- An entry can be inspected in detail without leaving the transcript.
121 -- Entry state is presentation only and never alters session history.
123 -```mermaid
124 -stateDiagram-v2
125 - [*] --> Collapsed: entry appended
126 - Collapsed --> Expanded: expand
127 - Expanded --> Collapsed: collapse
128 - Expanded --> Located: follow reference
129 - Located --> Expanded: return
130 -```
132 -## Tool presentation
134 -A tool call is work the user did not watch happen, so the transcript has to account for it.
136 -- A tool entry names what the tool acted on, and once it finishes, how it ended.
137 -- A completed edit presents its change as a diff, distinguishing added from removed lines, and that diff can be opened as a full editor comparison on request.
138 -- Navigating from an edit reaches its first changed line rather than the start of the file.
139 -- Output a tool produces while it runs appears as it arrives, not only at completion.
140 -- Output is presented in the language it came from when that language is known.
141 -- A result the agent could not keep in full says so, and its full output stays reachable.
142 -- An outcome stays legible while an entry is collapsed.
143 -- A tool that reports nothing about its own work degrades to naming its subject rather than to a guess.
145 -```mermaid
146 -stateDiagram-v2
147 - [*] --> Started: tool call
148 - Started --> Streaming: output arrives
149 - Streaming --> Completed: tool ends
150 - Started --> Completed: tool ends
151 - Completed --> Compared: open the change
152 - Compared --> Completed: return
153 -```
155 -## Agent activity
157 -- Active edits may use signs, line highlights, extmarks, virtual text, or virtual lines.
158 -- Completed edits leave a navigable changed-line trail until cleared by defined editor activity or session action.
159 -- Activity belongs to its Pi session and does not overwrite unrelated diagnostic or extmark namespaces.
160 -- File and range references are navigable through normal Neovim motions and lists.
161 -- Cross-file findings use quickfix lists.
162 -- Window-associated findings use location lists.
163 -- AI diagnostics remain distinguishable from compiler and language-server diagnostics.
165 -## Follow-agent mode
167 -- Follow mode is optional and disabled unless selected by the user.
168 -- It follows location-bearing reads, edits, findings, and explicit navigation rather than every event.
169 -- It can follow in a dedicated window, a dedicated tab, or the current window.
170 -- Dedicated-window following preserves the user's working window.
171 -- Passive following avoids unnecessary jumplist pollution.
172 -- The user can return to the location held before following began.
174 -## Pi compatibility
176 -- The companion extension is shipped with pivi and injected additively when Pi starts.
177 -- User, project, package, provider, skill, prompt, and tool configuration continues to load under Pi's normal rules.
178 -- pivi does not silently alter Pi project trust or restrict available tools.
179 -- Extension tools, commands, hooks, prompt changes, session behavior, and supported RPC dialogs remain functional.
180 -- TUI-only renderers, custom components, keybindings, headers, footers, and terminal input are not emulated.
181 -- Supported extension dialogs and status requests map to native Neovim surfaces.
182 -- Unrestricted Neovim Lua execution is available alongside structured convenience tools.
184 -## Native integration invariant
186 -pivi is an optional producer of native Neovim state, never the owner of surrounding configuration.
188 -- It does not replace or require a statusline, winbar, tabline, picker, notification system, layout, or keymap framework.
189 -- It publishes cached state through native variables and semantic `User` events.
190 -- It offers commands and `<Plug>` mappings without imposing global mappings.
191 -- Consumers can degrade to ordinary Neovim behavior when pivi is absent.
192 -- Loading pivi succeeds when the Pi executable is unavailable; starting Pi reports the missing capability.
193 -- Status consumers never perform Pi RPC during statusline evaluation.
195 -## Transport and status
197 -- Pi RPC uses a non-terminal JSONL subprocess channel.
198 -- Terminal dimensions, alternate screens, cursor escapes, and terminal key forwarding are not part of pivi.
199 -- Standard error remains separate from protocol output.
200 -- ANSI styling in payload text is stripped or translated before native presentation.
201 -- Semantic session status includes connection, queue, run, tool, waiting, compaction, retry, abort, and error states.
202 -- Status also exposes available model, thinking, session, context, usage, and extension-status data.
203 -- Status changes redraw native status surfaces and emit a semantic event.
205 -## Acceptance criteria
207 -- A Pi slash command can run through `:Pi command ...`; `/` invokes slash-command entry only at the first character of a Pi input buffer.
208 -- A transcript renders message formatting, presents embedded code in its own language, and still yields the original text when copied.
209 -- A completed edit shows added and removed lines distinctly and can be opened as an editor comparison.
210 -- Navigating from an edit entry lands on its first changed line.
211 -- Output of a long-running tool appears progressively rather than only at completion.
212 -- A truncated result is marked as truncated and its full output stays reachable.
213 -- A collapsed tool entry still states what the tool acted on and how it ended.
214 -- A tool result is collapsed on arrival, expands on request, and collapsing never changes session history.
215 -- A user can move between transcript entries with ordinary motions and reach the location an entry names.
216 -- Transcript presentation performs no Pi RPC, and a long streamed answer stays responsive.
217 -- `:Pi help` answers while a working session run is active, without appearing in that session's history, queue, or status.
218 -- A help question carries the visible editor region, layout, selection, recent messages, and the last error, and no full buffer.
219 -- Help can answer an editor documentation question from the running instance, including documentation of installed plugins.
220 -- No help run can modify a buffer, a file, or Pi state.
221 -- A submission made during an active run is queued with explicit delivery and can be listed and cleared before delivery.
222 -- A user can create, resume, switch, and stop explicit Pi sessions without tying their lifetime to a source buffer or tab.
223 -- A prompt can include an unsaved selection with stable source and revision metadata.
224 -- Pi can read unsaved loaded-buffer content and use current core Neovim context on demand.
225 -- Pi can execute arbitrary Neovim Lua and use structured editor operations.
226 -- A normal Pi edit to a loaded buffer appears without reload, is undoable, remains coherent with subsequent shell work, and receives visible activity markers.
227 -- Streaming edit arguments can produce non-mutating ghost presentation; incomplete arguments never mutate the real buffer.
228 -- Follow mode can track an agent edit in a dedicated viewport without taking over the user's working window.
229 -- Quickfix, location-list, diagnostic, and file navigation use normal Neovim behavior.
230 -- Existing Pi extensions and tools continue to run except for capabilities inherently specific to Pi's TUI.
231 -- A custom Neovim configuration can consume pivi state and events without requiring pivi to be installed or loaded.
232 -- pivi does not modify user-owned statuslines, winbars, tablines, global mappings, or picker configuration.
233 -- No filesystem watcher is started.

neovim/.system/specs/NL-SPEC-GMWDCMJZ-pivi-native-neovim-integration/native-agent-trail.html

Deleted
deleted file mode 100644
1 -<section class="pivi-mockup">
2 - <style>
3 - :host { color-scheme: dark; font: 14px/1.35 ui-monospace, "Cascadia Mono", Consolas, monospace; }
4 - .pivi-mockup { max-width: 1120px; margin: 0 auto; color: #d7d7d7; background: #17191d; border: 1px solid #464b55; box-shadow: 0 10px 35px #0008; }
5 - .tabs, .winbar, .status { display: flex; align-items: center; min-height: 1.7em; padding: 0 .65em; white-space: pre; }
6 - .tabs { background: #242830; gap: 1.1em; color: #a9b0bc; }
7 - .tabs .active { color: #f0f0f0; background: #343945; margin: 0 -.4em; padding: 0 .4em; }
8 - .workspace { display: grid; grid-template-columns: minmax(0, 3fr) minmax(24em, 2fr); min-height: 29em; }
9 - .window { min-width: 0; position: relative; }
10 - .window + .window { border-left: 1px solid #464b55; }
11 - .winbar { justify-content: space-between; background: #202329; color: #bfc5cf; border-bottom: 1px solid #30343c; }
12 - .agent { color: #deb887; }
13 - .buffer { padding: .45em 0 1em; overflow: hidden; }
14 - .line { display: grid; grid-template-columns: 2em 1.2em minmax(0, 1fr); min-height: 1.45em; }
15 - .num { color: #636b78; text-align: right; padding-right: .45em; user-select: none; }
16 - .sign { color: #7f8794; text-align: center; }
17 - .code { white-space: pre; overflow: hidden; }
18 - .kw { color: #d49adf; } .str { color: #e6c384; }
19 - .editing { background: #3a3223; }
20 - .editing .sign { color: #efbd6b; }
21 - .changed { background: #22352c; }
22 - .changed .sign { color: #8ec07c; }
23 - .virt { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); color: #87b98b; background: #1c2923; }
24 - .virt::before { content: "+"; text-align: right; padding-right: .55em; color: #8ec07c; }
25 - .ghost { color: #98a1ad; font-style: italic; }
26 - .status { justify-content: space-between; background: #292d35; color: #ccd0d8; border-top: 1px solid #464b55; }
27 - .external { color: #89919e; }
28 - .controls { display: flex; gap: .5em; padding: .65em; border-top: 1px solid #343944; background: #202329; }
29 - button { font: inherit; color: #d7d7d7; background: #303540; border: 1px solid #565d69; padding: .3em .7em; }
30 - button[aria-pressed="true"] { border-color: #d7a85d; color: #f3c77b; }
31 - button:focus-visible { outline: 2px solid #9ccfd8; outline-offset: 2px; }
32 - .note { margin-left: auto; align-self: center; color: #7f8794; }
33 - </style>
34 - <div class="tabs"><span class="active">1 api</span><span>2 tests</span><span>3 docs</span><span class="agent">π refactor-parser</span></div>
35 - <div class="workspace">
36 - <article class="window">
37 - <header class="winbar"><span>lua/parser.lua</span><span>human workspace</span></header>
38 - <div class="buffer">
39 - <div class="line"><span class="num">38</span><span class="sign"> </span><span class="code"><span class="kw">local function</span> parse(input)</span></div>
40 - <div class="line"><span class="num">39</span><span class="sign"> </span><span class="code"> <span class="kw">local</span> tokens = tokenize(input)</span></div>
41 - <div class="line changed"><span class="num">40</span><span class="sign">┃</span><span class="code"> <span class="kw">return</span> parse_tokens(tokens)</span></div>
42 - <div class="line"><span class="num">41</span><span class="sign"> </span><span class="code"><span class="kw">end</span></span></div>
43 - <div class="line"><span class="num">42</span><span class="sign"> </span><span class="code"></span></div>
44 - <div class="line"><span class="num">43</span><span class="sign"> </span><span class="code"><span class="kw">return</span> { parse = parse }</span></div>
45 - </div>
46 - </article>
47 - <article class="window">
48 - <header class="winbar"><span>lua/tokenize.lua</span><span class="agent">π editing 17:19</span></header>
49 - <div class="buffer">
50 - <div class="line"><span class="num">15</span><span class="sign"> </span><span class="code"><span class="kw">local function</span> scan(input)</span></div>
51 - <div class="line"><span class="num">16</span><span class="sign"> </span><span class="code"> <span class="kw">local</span> result = {}</span></div>
52 - <div class="line editing"><span class="num">17</span><span class="sign">●</span><span class="code"> <span class="kw">for</span> token <span class="kw">in</span> input:gmatch(<span class="str">'%S+'</span>) <span class="kw">do</span> <span class="ghost">π editing…</span></span></div>
53 - <div class="virt"><span></span><span class="code"> result[#result + 1] = normalize(token)</span></div>
54 - <div class="line editing"><span class="num">18</span><span class="sign">│</span><span class="code"> result[#result + 1] = token</span></div>
55 - <div class="line editing"><span class="num">19</span><span class="sign">└</span><span class="code"> <span class="kw">end</span></span></div>
56 - <div class="line"><span class="num">20</span><span class="sign"> </span><span class="code"> <span class="kw">return</span> result</span></div>
57 - <div class="line"><span class="num">21</span><span class="sign"> </span><span class="code"><span class="kw">end</span></span></div>
58 - </div>
59 - </article>
60 - </div>
61 - <footer class="status"><span>NORMAL lua/parser.lua</span><span class="external">existing user-owned statusline remains untouched</span><span>40:3</span></footer>
62 - <div class="controls" aria-label="Representative controls">
63 - <button type="button" data-follow aria-pressed="true">Follow: window</button>
64 - <button type="button" data-state aria-pressed="false">Show completed state</button>
65 - <span class="note">Illustrative interaction only</span>
66 - </div>
67 - <script>
68 - (() => {
69 - const root = document.currentScript.mockupRoot;
70 - const follow = root.querySelector('[data-follow]');
71 - const state = root.querySelector('[data-state]');
72 - follow.addEventListener('click', () => {
73 - const on = follow.getAttribute('aria-pressed') !== 'true';
74 - follow.setAttribute('aria-pressed', String(on));
75 - follow.textContent = on ? 'Follow: window' : 'Follow: off';
76 - });
77 - state.addEventListener('click', () => {
78 - const completed = state.getAttribute('aria-pressed') !== 'true';
79 - state.setAttribute('aria-pressed', String(completed));
80 - state.textContent = completed ? 'Show active state' : 'Show completed state';
81 - root.querySelectorAll('.editing').forEach((line) => {
82 - line.classList.toggle('editing', !completed);
83 - line.classList.toggle('changed', completed);
84 - });
85 - const winbar = root.querySelectorAll('.winbar')[1].lastElementChild;
86 - winbar.textContent = completed ? 'π edited 17:19' : 'π editing 17:19';
87 - const ghost = root.querySelector('.ghost');
88 - ghost.textContent = completed ? 'π changed' : 'π editing…';
89 - });
90 - })();
91 - </script>
92 -</section>

neovim/.system/specs/NVIM-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md

Added
new file mode 100644
1 +---
2 +id: NVIM-SPEC-GMWDCMJZ
3 +type: spec
4 +title: pivi Native Neovim Integration
5 +research:
6 + - NVIM-RESEARCH-KZYYEFY_
7 +---
9 +# pivi Native Neovim Integration
11 +## Intent
13 +pivi makes Pi feel native inside Neovim rather than embedding Pi's terminal interface.
14 +Pi remains a fully empowered coding agent.
15 +Neovim supplies editing, navigation, presentation, and live editor context.
17 +[Accepted native edit and follow-mode mockup](./native-agent-trail.html)
19 +## Scope
21 +pivi provides:
23 +- Persistent Pi sessions controlled through Pi RPC.
24 +- Neovim buffers for prompts, transcripts, session navigation, and detailed output.
25 +- Native quickfix lists, location lists, diagnostics, extmarks, signs, diffs, and navigation.
26 +- Live access to core Neovim state and unrestricted Neovim Lua execution.
27 +- A bundled Pi companion extension loaded in addition to the user's normal Pi configuration.
29 +Initial editor tools focus on buffers, selections, windows, tabs, marks, jumps, changes, lists, diagnostics, commands, and Lua execution.
30 +LSP-specific tools are outside the initial scope.
32 +## Session behavior
34 +- A Pi session is an explicit task identity with persistent history.
35 +- Each session captures a working directory as its execution scope.
36 +- Multiple sessions may share one working directory.
37 +- A tab may select a default session but does not own its lifetime.
38 +- Source buffers do not own sessions.
39 +- Closing a session window hides presentation without deleting history or implicitly stopping Pi.
40 +- While a session run is active, a new submission is queued with an explicit delivery choice and is never silently dropped.
41 +- Queued submissions remain listable and clearable before delivery.
43 +```mermaid
44 +stateDiagram-v2
45 + [*] --> Idle
46 + Idle --> Running: submit
47 + Running --> Running: queue steering or follow-up
48 + Running --> Idle: settle
49 + Running --> Idle: abort
50 + Idle --> [*]: stop session
51 +```
53 +## Slash commands
55 +- Pi slash commands are available through `:Pi command ...`.
56 +- Only commands Pi exposes to non-interactive clients are offered; terminal-only commands are absent.
57 +- In a Pi input buffer, `/` invokes slash-command entry only when the cursor is at the first character.
58 +- Elsewhere, `/` retains ordinary Neovim behavior.
60 +## One-shot help
62 +- `:Pi help` answers a fast question about Neovim, pivi, or Pi.
63 +- Help runs as an independent ephemeral agent run with no persisted session and no shared history.
64 +- Help never enters a working session's transcript, queue, or status.
65 +- Help stays available while a working session runs, and neither delays nor interrupts it.
66 +- Help failure is isolated and never degrades a working session.
67 +- Help may read, and never modifies the editor, the filesystem, or Pi state.
68 +- Each question carries what the user can currently see rather than whole buffers.
69 +- Editor documentation is answered from the running instance, so the version and installed plugins decide the answer.
70 +- pivi's own behavior is supplied as knowledge to the agent rather than assumed.
72 +```mermaid
73 +flowchart LR
74 + editor["Neovim"] --> session["Working session run"]
75 + editor --> help["Ephemeral help run"]
76 + session --> history["Persistent session history"]
77 + help --> discard["Discarded after answer"]
78 + help --> readonly["Read-only editor and documentation lookups"]
79 +```
81 +## Editor context
83 +- Each submission may carry an immutable snapshot of its originating buffer, path, revision, cursor, range, selection kind, selected text, and bounded surrounding text.
84 +- Queued submissions retain their own snapshots.
85 +- Pi can obtain fresh ambient editor state before later model calls.
86 +- Full buffer contents are fetched on demand rather than attaching every open buffer automatically.
87 +- Loaded buffers, including unsaved contents, are authoritative for editor-aware reads.
88 +- The Pi prompt receives a short stable orientation to the live Neovim environment without replacing existing system or project instructions.
90 +## Editing
92 +- Pi may edit without an approval gate.
93 +- Reads, edits, and writes preserve the behavior and improvements of Pi's upstream tools while making loaded Neovim buffers authoritative.
94 +- Agent changes to loaded buffers appear directly in Neovim, remain undoable, and become visible to filesystem-based commands without requiring manual reload.
95 +- Unloaded paths retain normal Pi filesystem behavior.
96 +- Validated edit intent may appear progressively as ghost text while tool arguments stream.
97 +- Real buffer mutation begins only after complete valid edit arguments exist.
98 +- An edit operation presents one coherent undoable change where Neovim permits it.
99 +- pivi uses no filesystem watchers.
100 +- Arbitrary shell or third-party tool mutations without identified paths are not represented as precise editor edits.
102 +## Transcript presentation
104 +A transcript is the conversation itself, presented as the document it already is.
106 +- Transcript text is the messages as authored; pivi's own framing is presentation rather than content.
107 +- Copying transcript text yields the original message text, without framing.
108 +- Message formatting is rendered rather than shown as markup, and embedded code is presented in its own language.
109 +- Rendering degrades to plain readable text when a format cannot be rendered.
110 +- Presentation never performs Pi RPC, and streaming stays responsive as a transcript grows.
112 +## Transcript navigation
114 +Every transcript entry is an addressable unit: a submission, an answer, a tool call, a tool result, or an error.
116 +- An entry can be collapsed to a single readable line or expanded to its full content.
117 +- Voluminous entries, such as tool results, start collapsed.
118 +- The user can move between entries, and between tool calls, with ordinary motions.
119 +- An entry that names a location is navigable to that location.
120 +- An entry can be inspected in detail without leaving the transcript.
121 +- Entry state is presentation only and never alters session history.
123 +```mermaid
124 +stateDiagram-v2
125 + [*] --> Collapsed: entry appended
126 + Collapsed --> Expanded: expand
127 + Expanded --> Collapsed: collapse
128 + Expanded --> Located: follow reference
129 + Located --> Expanded: return
130 +```
132 +## Tool presentation
134 +A tool call is work the user did not watch happen, so the transcript has to account for it.
136 +- A tool entry names what the tool acted on, and once it finishes, how it ended.
137 +- A completed edit presents its change as a diff, distinguishing added from removed lines, and that diff can be opened as a full editor comparison on request.
138 +- Navigating from an edit reaches its first changed line rather than the start of the file.
139 +- Output a tool produces while it runs appears as it arrives, not only at completion.
140 +- Output is presented in the language it came from when that language is known.
141 +- A result the agent could not keep in full says so, and its full output stays reachable.
142 +- An outcome stays legible while an entry is collapsed.
143 +- A tool that reports nothing about its own work degrades to naming its subject rather than to a guess.
145 +```mermaid
146 +stateDiagram-v2
147 + [*] --> Started: tool call
148 + Started --> Streaming: output arrives
149 + Streaming --> Completed: tool ends
150 + Started --> Completed: tool ends
151 + Completed --> Compared: open the change
152 + Compared --> Completed: return
153 +```
155 +## Agent activity
157 +- Active edits may use signs, line highlights, extmarks, virtual text, or virtual lines.
158 +- Completed edits leave a navigable changed-line trail until cleared by defined editor activity or session action.
159 +- Activity belongs to its Pi session and does not overwrite unrelated diagnostic or extmark namespaces.
160 +- File and range references are navigable through normal Neovim motions and lists.
161 +- Cross-file findings use quickfix lists.
162 +- Window-associated findings use location lists.
163 +- AI diagnostics remain distinguishable from compiler and language-server diagnostics.
165 +## Follow-agent mode
167 +- Follow mode is optional and disabled unless selected by the user.
168 +- It follows location-bearing reads, edits, findings, and explicit navigation rather than every event.
169 +- It can follow in a dedicated window, a dedicated tab, or the current window.
170 +- Dedicated-window following preserves the user's working window.
171 +- Passive following avoids unnecessary jumplist pollution.
172 +- The user can return to the location held before following began.
174 +## Pi compatibility
176 +- The companion extension is shipped with pivi and injected additively when Pi starts.
177 +- User, project, package, provider, skill, prompt, and tool configuration continues to load under Pi's normal rules.
178 +- pivi does not silently alter Pi project trust or restrict available tools.
179 +- Extension tools, commands, hooks, prompt changes, session behavior, and supported RPC dialogs remain functional.
180 +- TUI-only renderers, custom components, keybindings, headers, footers, and terminal input are not emulated.
181 +- Supported extension dialogs and status requests map to native Neovim surfaces.
182 +- Unrestricted Neovim Lua execution is available alongside structured convenience tools.
184 +## Native integration invariant
186 +pivi is an optional producer of native Neovim state, never the owner of surrounding configuration.
188 +- It does not replace or require a statusline, winbar, tabline, picker, notification system, layout, or keymap framework.
189 +- It publishes cached state through native variables and semantic `User` events.
190 +- It offers commands and `<Plug>` mappings without imposing global mappings.
191 +- Consumers can degrade to ordinary Neovim behavior when pivi is absent.
192 +- Loading pivi succeeds when the Pi executable is unavailable; starting Pi reports the missing capability.
193 +- Status consumers never perform Pi RPC during statusline evaluation.
195 +## Transport and status
197 +- Pi RPC uses a non-terminal JSONL subprocess channel.
198 +- Terminal dimensions, alternate screens, cursor escapes, and terminal key forwarding are not part of pivi.
199 +- Standard error remains separate from protocol output.
200 +- ANSI styling in payload text is stripped or translated before native presentation.
201 +- Semantic session status includes connection, queue, run, tool, waiting, compaction, retry, abort, and error states.
202 +- Status also exposes available model, thinking, session, context, usage, and extension-status data.
203 +- Status changes redraw native status surfaces and emit a semantic event.
205 +## Acceptance criteria
207 +- A Pi slash command can run through `:Pi command ...`; `/` invokes slash-command entry only at the first character of a Pi input buffer.
208 +- A transcript renders message formatting, presents embedded code in its own language, and still yields the original text when copied.
209 +- A completed edit shows added and removed lines distinctly and can be opened as an editor comparison.
210 +- Navigating from an edit entry lands on its first changed line.
211 +- Output of a long-running tool appears progressively rather than only at completion.
212 +- A truncated result is marked as truncated and its full output stays reachable.
213 +- A collapsed tool entry still states what the tool acted on and how it ended.
214 +- A tool result is collapsed on arrival, expands on request, and collapsing never changes session history.
215 +- A user can move between transcript entries with ordinary motions and reach the location an entry names.
216 +- Transcript presentation performs no Pi RPC, and a long streamed answer stays responsive.
217 +- `:Pi help` answers while a working session run is active, without appearing in that session's history, queue, or status.
218 +- A help question carries the visible editor region, layout, selection, recent messages, and the last error, and no full buffer.
219 +- Help can answer an editor documentation question from the running instance, including documentation of installed plugins.
220 +- No help run can modify a buffer, a file, or Pi state.
221 +- A submission made during an active run is queued with explicit delivery and can be listed and cleared before delivery.
222 +- A user can create, resume, switch, and stop explicit Pi sessions without tying their lifetime to a source buffer or tab.
223 +- A prompt can include an unsaved selection with stable source and revision metadata.
224 +- Pi can read unsaved loaded-buffer content and use current core Neovim context on demand.
225 +- Pi can execute arbitrary Neovim Lua and use structured editor operations.
226 +- A normal Pi edit to a loaded buffer appears without reload, is undoable, remains coherent with subsequent shell work, and receives visible activity markers.
227 +- Streaming edit arguments can produce non-mutating ghost presentation; incomplete arguments never mutate the real buffer.
228 +- Follow mode can track an agent edit in a dedicated viewport without taking over the user's working window.
229 +- Quickfix, location-list, diagnostic, and file navigation use normal Neovim behavior.
230 +- Existing Pi extensions and tools continue to run except for capabilities inherently specific to Pi's TUI.
231 +- A custom Neovim configuration can consume pivi state and events without requiring pivi to be installed or loaded.
232 +- pivi does not modify user-owned statuslines, winbars, tablines, global mappings, or picker configuration.
233 +- No filesystem watcher is started.

neovim/.system/specs/NVIM-SPEC-GMWDCMJZ-pivi-native-neovim-integration/native-agent-trail.html

Added
new file mode 100644
1 +<section class="pivi-mockup">
2 + <style>
3 + :host { color-scheme: dark; font: 14px/1.35 ui-monospace, "Cascadia Mono", Consolas, monospace; }
4 + .pivi-mockup { max-width: 1120px; margin: 0 auto; color: #d7d7d7; background: #17191d; border: 1px solid #464b55; box-shadow: 0 10px 35px #0008; }
5 + .tabs, .winbar, .status { display: flex; align-items: center; min-height: 1.7em; padding: 0 .65em; white-space: pre; }
6 + .tabs { background: #242830; gap: 1.1em; color: #a9b0bc; }
7 + .tabs .active { color: #f0f0f0; background: #343945; margin: 0 -.4em; padding: 0 .4em; }
8 + .workspace { display: grid; grid-template-columns: minmax(0, 3fr) minmax(24em, 2fr); min-height: 29em; }
9 + .window { min-width: 0; position: relative; }
10 + .window + .window { border-left: 1px solid #464b55; }
11 + .winbar { justify-content: space-between; background: #202329; color: #bfc5cf; border-bottom: 1px solid #30343c; }
12 + .agent { color: #deb887; }
13 + .buffer { padding: .45em 0 1em; overflow: hidden; }
14 + .line { display: grid; grid-template-columns: 2em 1.2em minmax(0, 1fr); min-height: 1.45em; }
15 + .num { color: #636b78; text-align: right; padding-right: .45em; user-select: none; }
16 + .sign { color: #7f8794; text-align: center; }
17 + .code { white-space: pre; overflow: hidden; }
18 + .kw { color: #d49adf; } .str { color: #e6c384; }
19 + .editing { background: #3a3223; }
20 + .editing .sign { color: #efbd6b; }
21 + .changed { background: #22352c; }
22 + .changed .sign { color: #8ec07c; }
23 + .virt { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); color: #87b98b; background: #1c2923; }
24 + .virt::before { content: "+"; text-align: right; padding-right: .55em; color: #8ec07c; }
25 + .ghost { color: #98a1ad; font-style: italic; }
26 + .status { justify-content: space-between; background: #292d35; color: #ccd0d8; border-top: 1px solid #464b55; }
27 + .external { color: #89919e; }
28 + .controls { display: flex; gap: .5em; padding: .65em; border-top: 1px solid #343944; background: #202329; }
29 + button { font: inherit; color: #d7d7d7; background: #303540; border: 1px solid #565d69; padding: .3em .7em; }
30 + button[aria-pressed="true"] { border-color: #d7a85d; color: #f3c77b; }
31 + button:focus-visible { outline: 2px solid #9ccfd8; outline-offset: 2px; }
32 + .note { margin-left: auto; align-self: center; color: #7f8794; }
33 + </style>
34 + <div class="tabs"><span class="active">1 api</span><span>2 tests</span><span>3 docs</span><span class="agent">π refactor-parser</span></div>
35 + <div class="workspace">
36 + <article class="window">
37 + <header class="winbar"><span>lua/parser.lua</span><span>human workspace</span></header>
38 + <div class="buffer">
39 + <div class="line"><span class="num">38</span><span class="sign"> </span><span class="code"><span class="kw">local function</span> parse(input)</span></div>
40 + <div class="line"><span class="num">39</span><span class="sign"> </span><span class="code"> <span class="kw">local</span> tokens = tokenize(input)</span></div>
41 + <div class="line changed"><span class="num">40</span><span class="sign">┃</span><span class="code"> <span class="kw">return</span> parse_tokens(tokens)</span></div>
42 + <div class="line"><span class="num">41</span><span class="sign"> </span><span class="code"><span class="kw">end</span></span></div>
43 + <div class="line"><span class="num">42</span><span class="sign"> </span><span class="code"></span></div>
44 + <div class="line"><span class="num">43</span><span class="sign"> </span><span class="code"><span class="kw">return</span> { parse = parse }</span></div>
45 + </div>
46 + </article>
47 + <article class="window">
48 + <header class="winbar"><span>lua/tokenize.lua</span><span class="agent">π editing 17:19</span></header>
49 + <div class="buffer">
50 + <div class="line"><span class="num">15</span><span class="sign"> </span><span class="code"><span class="kw">local function</span> scan(input)</span></div>
51 + <div class="line"><span class="num">16</span><span class="sign"> </span><span class="code"> <span class="kw">local</span> result = {}</span></div>
52 + <div class="line editing"><span class="num">17</span><span class="sign">●</span><span class="code"> <span class="kw">for</span> token <span class="kw">in</span> input:gmatch(<span class="str">'%S+'</span>) <span class="kw">do</span> <span class="ghost">π editing…</span></span></div>
53 + <div class="virt"><span></span><span class="code"> result[#result + 1] = normalize(token)</span></div>
54 + <div class="line editing"><span class="num">18</span><span class="sign">│</span><span class="code"> result[#result + 1] = token</span></div>
55 + <div class="line editing"><span class="num">19</span><span class="sign">└</span><span class="code"> <span class="kw">end</span></span></div>
56 + <div class="line"><span class="num">20</span><span class="sign"> </span><span class="code"> <span class="kw">return</span> result</span></div>
57 + <div class="line"><span class="num">21</span><span class="sign"> </span><span class="code"><span class="kw">end</span></span></div>
58 + </div>
59 + </article>
60 + </div>
61 + <footer class="status"><span>NORMAL lua/parser.lua</span><span class="external">existing user-owned statusline remains untouched</span><span>40:3</span></footer>
62 + <div class="controls" aria-label="Representative controls">
63 + <button type="button" data-follow aria-pressed="true">Follow: window</button>
64 + <button type="button" data-state aria-pressed="false">Show completed state</button>
65 + <span class="note">Illustrative interaction only</span>
66 + </div>
67 + <script>
68 + (() => {
69 + const root = document.currentScript.mockupRoot;
70 + const follow = root.querySelector('[data-follow]');
71 + const state = root.querySelector('[data-state]');
72 + follow.addEventListener('click', () => {
73 + const on = follow.getAttribute('aria-pressed') !== 'true';
74 + follow.setAttribute('aria-pressed', String(on));
75 + follow.textContent = on ? 'Follow: window' : 'Follow: off';
76 + });
77 + state.addEventListener('click', () => {
78 + const completed = state.getAttribute('aria-pressed') !== 'true';
79 + state.setAttribute('aria-pressed', String(completed));
80 + state.textContent = completed ? 'Show active state' : 'Show completed state';
81 + root.querySelectorAll('.editing').forEach((line) => {
82 + line.classList.toggle('editing', !completed);
83 + line.classList.toggle('changed', completed);
84 + });
85 + const winbar = root.querySelectorAll('.winbar')[1].lastElementChild;
86 + winbar.textContent = completed ? 'π edited 17:19' : 'π editing 17:19';
87 + const ghost = root.querySelector('.ghost');
88 + ghost.textContent = completed ? 'π changed' : 'π editing…';
89 + });
90 + })();
91 + </script>
92 +</section>

neovim/lua/bugabinga/pivi/AGENTS.md

Modified
4 4 # pivi — testing rules
6 6 pivi drives an external Pi process over JSONL RPC and mutates live buffers.
7 7 Both properties break the usual "require the module, assert side effects" pattern.
8 8 Follow these rules; they are load-bearing, not style.
10 -Spec: `.system/specs/NL-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md`.
11 -Research (Pi 0.85.1 / nvim 0.12 API facts): `.system/research/NL-RESEARCH-KZYYEFY_-pi-and-neovim-capabilities-for-pivi/index.md`.
10 +Spec: `.system/specs/NVIM-SPEC-GMWDCMJZ-pivi-native-neovim-integration/index.md`.
11 +Research (Pi 0.85.1 / nvim 0.12 API facts): `.system/research/NVIM-RESEARCH-KZYYEFY_-pi-and-neovim-capabilities-for-pivi/index.md`.
13 13 ## Test layers

pi/agent/prompts/deslop.md

Modified
2 2 description: Review code slop; change approved scope only after go
3 -mask: sol
4 3 tools: [read, write, edit, bash, grep, find, ls, angel, ask_user_question]
5 4 argument-hint: "<file|directory|diff|scope>"

pi/agent/prompts/fix.md

Modified
2 2 description: Fix bug with systematic debugging
3 -mask: sol
4 3 tools: [read, write, edit, bash, grep, find, ls, angel, ask_user_question]
5 4 argument-hint: "<bug-description-or-error>"

pi/agent/prompts/live-browser-test.md

Modified
2 2 description: Live-test a browser UI with Chrome CDP or Firefox BiDi
3 -mask: sol
4 3 argument-hint: "<url-or-app> :: <scenario/use-case>"
5 4 tools: [read, write, bash, grep, find, ls, ask_user_question]
6 5 thinking: high

pi/agent/prompts/live-terminal-test.md

Modified
2 2 description: Live-test an interactive CLI/TUI in observable terminal/tmux
3 -mask: sol
4 3 argument-hint: "<command-or-app> :: <scenario/use-case>"
5 4 tools: [read, write, bash, grep, find, ls, ask_user_question]
6 5 thinking: high

pi/agent/prompts/optimize.md

Modified
2 2 description: Benchmark and optimize code
3 -mask: sol
4 3 tools: [read, write, edit, bash, grep, find, ls, angel, ask_user_question]
5 4 argument-hint: "<function-or-file>"

pi/agent/prompts/pr.md

Modified
2 2 description: Review, checkout, test, and prepare PR merge for git/jj repos
3 -mask: sol
4 3 tools: [read, bash, grep, find, ls, git_clone_safe, angel, ask_user_question]
5 4 argument-hint: "[pr-url|number|branch|ref] [test-command]"

pi/agent/prompts/refactor.md

Modified
2 2 description: Refactor code safely
3 -mask: sol
4 3 tools: [read, write, edit, bash, grep, find, ls, angel, ask_user_question]
5 4 argument-hint: "<file-or-directory>"

pi/agent/prompts/tech-review.md

Modified
2 2 description: Run the ISP technology-review workflow from evidence to team decision
3 -mask: sol
4 3 tools: [read, write, bash, grep, find, ls, web, ask_user_question]
5 4 argument-hint: "<technology> [target-project or question]"

pi/agent/settings.json

Modified
2 - "lastChangelogVersion": "0.87.0",
3 - "packages": [
4 - "~/Workspace/pi-ext"
5 - ],
6 - "skills": [
7 - "-skills/fxdriver/fxdriver-instructions/SKILL.md",
8 - "-skills/fxdriver/fxdriver/SKILL.md",
9 - "-skills/java/java-class-file-api/SKILL.md",
10 - "-skills/java/java-ffm/SKILL.md",
11 - "-skills/java/java-final-field-mutation/SKILL.md",
12 - "-skills/java/java-flexible-constructors/SKILL.md",
13 - "-skills/java/java-http3-client/SKILL.md",
14 - "-skills/java/java-kdf-api/SKILL.md",
15 - "-skills/java/java-kem-api/SKILL.md",
16 - "-skills/java/java-markdown-doc-comments/SKILL.md",
17 - "-skills/java/java-ml-dsa/SKILL.md",
18 - "-skills/java/java-ml-kem/SKILL.md",
19 - "-skills/java/java-module-imports/SKILL.md",
20 - "-skills/java/java-native-access-restrictions/SKILL.md",
21 - "-skills/java/java-pattern-switch/SKILL.md",
22 - "-skills/java/java-record-patterns/SKILL.md",
23 - "-skills/java/java-scoped-values/SKILL.md",
24 - "-skills/java/java-security-manager-disabled/SKILL.md",
25 - "-skills/java/java-sequenced-collections/SKILL.md",
26 - "-skills/java/java-source-scripts/SKILL.md",
27 - "-skills/java/java-stream-gatherers/SKILL.md",
28 - "-skills/java/java-unnamed-variables-patterns/SKILL.md",
29 - "-skills/java/java-unsafe-memory-migration/SKILL.md",
30 - "-skills/java/java-virtual-threads/SKILL.md",
31 - "-skills/mdbook/SKILL.md",
32 - "-skills/niri/SKILL.md",
33 - "-skills/qml/SKILL.md",
34 - "-skills/quickshell/SKILL.md",
35 - "-skills/rust-maud/SKILL.md",
36 - "-skills/wezterm/SKILL.md",
37 - "-skills/luci-ci/SKILL.md",
38 - "-skills/chrome-cdp/SKILL.md",
39 - "-skills/firefox-bidi/SKILL.md",
40 - "-skills/x230/SKILL.md",
41 - "-skills/archlinux/SKILL.md",
42 - "-skills/ascii-boxes/SKILL.md",
43 - "-skills/jj/jj-bookmark-move/SKILL.md",
44 - "-skills/jj/jj-commit/SKILL.md",
45 - "-skills/jj/jj-review/SKILL.md",
46 - "-skills/jj/jj-sync/SKILL.md",
47 - "-skills/linux/SKILL.md",
48 - "-skills/linux-console/SKILL.md",
49 - "-skills/linux-userland/SKILL.md",
50 - "-skills/presenterm/SKILL.md",
51 - "-skills/security/SKILL.md",
52 - "-skills/terminal-harness/SKILL.md",
53 - "-skills/win32-drive/SKILL.md"
54 - ],
55 - "theme": "terminal",
56 - "defaultProvider": "openai-codex",
57 - "defaultModel": "gpt-5.6-luna",
58 - "defaultThinkingLevel": "high",
59 - "defaultTools": [
60 - "bash",
61 - "edit",
62 - "read",
63 - "write",
64 - "ls",
65 - "grep"
66 - ],
67 - "horst": {
68 - "os": {
69 - "win32": { "tools": { "add": ["powershell"], "remove": ["bash"] } }
70 - }
71 - },
72 - "collapseChangelog": true,
73 - "editorPaddingX": 1,
74 - "tuiMode": "fullscreen",
75 - "fullscreenExitOutput": "resume-hint",
76 - "terminal": {
77 - "showTerminalProgress": true
78 - },
79 - "sessionDir": "~/.local/state/pi/sessions",
80 - "masks": {
81 - "pickerShortcut": "alt+m",
82 - "items": [
83 - {
84 - "name": "default",
85 - "model": "openai-codex/gpt-5.6-luna",
86 - "thinkingLevel": "high",
87 - "shortcut": "alt+0"
88 - },
89 - {
90 - "name": "glm",
91 - "model": "zai/glm-5.3-flash",
92 - "thinkingLevel": "high",
93 - "shortcut": "alt+1"
94 - },
95 - {
96 - "name": "sol",
97 - "model": "openai-codex/gpt-5.6-sol",
98 - "thinkingLevel": "medium",
99 - "shortcut": "alt+2"
100 - },
101 - {
102 - "name": "astra",
103 - "model": "openai-codex/gpt-6-astra",
104 - "thinkingLevel": "high",
105 - "shortcut": "alt+3"
106 - },
107 - {
108 - "name": "opus",
109 - "model": "klaus/claude-opus-5",
110 - "thinkingLevel": "high",
111 - "shortcut": "alt+4"
112 - },
113 - {
114 - "name": "fable",
115 - "model": "klaus/claude-fable-5-1",
116 - "thinkingLevel": "high",
117 - "shortcut": "alt+5"
118 - },
119 - {
120 - "name": "luna",
121 - "model": "openai-codex/gpt-5.6-luna",
122 - "thinkingLevel": "high"
123 - },
124 - {
125 - "name": "qwen3.6",
126 - "model": "hetzner/Qwen/Qwen3.6-35B-A3B-FP8",
127 - "thinkingLevel": "off"
128 - },
129 - {
130 - "name": "qwen3.8",
131 - "model": "hetzner/Qwen3.8-27B",
132 - "thinkingLevel": "medium"
133 - }
134 - ]
135 - },
136 - "angel": {
137 - "thinkingLevel": "high",
138 - "subagentExtensions": [
139 - "pfui",
140 - "klaus",
141 - "fast",
142 - "rtk",
143 - "uv",
144 - "git-safe",
145 - "web"
146 - ],
147 - "pairs": [
148 - {
149 - "executor": "openai-codex/gpt-5.6-sol",
150 - "advisor": "openai-codex/gpt-6-astra"
151 - },
152 - {
153 - "executor": "openai-codex/gpt-5.6-terra",
154 - "advisor": "openai-codex/gpt-5.6-sol"
155 - },
156 - {
157 - "executor": "openai-codex/gpt-5.6-luna",
158 - "advisor": "openai-codex/gpt-5.6-sol"
159 - },
160 - {
161 - "executor": "klaus/claude-opus-5",
162 - "advisor": "klaus/claude-fable-5-1"
163 - },
164 - {
165 - "executor": "zai/glm-5.3-flash",
166 - "advisor": "zai/glm-5.3"
167 - }
168 - ]
169 - },
170 - "iq": {
171 - "judgeModel": "zai/glm-5.3",
172 - "stateDir": "~/Notes/LLMs",
173 - "counterJudgeModel": [
174 - "openai-codex/gpt-5.6-sol",
175 - "openai-codex/gpt-6-astra",
176 - "klaus/claude-fable-5-1",
177 - "klaus/claude-opus-5"
178 - ],
179 - "counterSampleRate": 0.25
180 - },
181 - "fast": {
182 - "enable": true
183 - },
184 - "ultra": {
185 - "auto_enable": true,
186 - "subagentExtensions": [
187 - "pfui",
188 - "klaus",
189 - "angel",
190 - "fast",
191 - "git-safe",
192 - "rtk",
193 - "uv",
194 - "web"
195 - ],
196 - "actionSummarizerModel": "openai-codex/gpt-5.6-luna",
197 - "modelTiers": {
198 - "tiny": {
199 - "model": "openai-codex/gpt-5.6-luna",
200 - "thinkingLevel": "minimal"
201 - },
202 - "small": {
203 - "model": "openai-codex/gpt-5.6-luna",
204 - "thinkingLevel": "high"
205 - },
206 - "medium": {
207 - "model": "openai-codex/gpt-5.6-terra",
208 - "thinkingLevel": "high"
209 - },
210 - "large": {
211 - "model": "openai-codex/gpt-6-sol",
212 - "thinkingLevel": "high"
213 - },
214 - "huge": {
215 - "model": "openai-codex/gpt-6-astra",
216 - "thinkingLevel": "high"
217 - }
218 - }
219 - },
220 - "goodJob": {
221 - "model": "openai-codex/gpt-5.5",
222 - "thinkingLevel": "medium"
223 - },
224 - "decay": {
225 - "model": "openai-codex/gpt-5.6.luna",
226 - "summarizerModel": "openai-codex/gpt-5.5"
227 - },
228 - "intellij": {
229 - "url": "http://127.0.0.1:64343/stream"
230 - },
231 - "hideThinkingBlock": false
2 + "lastChangelogVersion": "0.87.1",
3 + "packages": ["~/Workspace/pi-ext"],
4 + "skills": [
5 + "-skills/fxdriver/fxdriver-instructions/SKILL.md",
6 + "-skills/fxdriver/fxdriver/SKILL.md",
7 + "-skills/java/java-class-file-api/SKILL.md",
8 + "-skills/java/java-ffm/SKILL.md",
9 + "-skills/java/java-final-field-mutation/SKILL.md",
10 + "-skills/java/java-flexible-constructors/SKILL.md",
11 + "-skills/java/java-http3-client/SKILL.md",
12 + "-skills/java/java-kdf-api/SKILL.md",
13 + "-skills/java/java-kem-api/SKILL.md",
14 + "-skills/java/java-markdown-doc-comments/SKILL.md",
15 + "-skills/java/java-ml-dsa/SKILL.md",
16 + "-skills/java/java-ml-kem/SKILL.md",
17 + "-skills/java/java-module-imports/SKILL.md",
18 + "-skills/java/java-native-access-restrictions/SKILL.md",
19 + "-skills/java/java-pattern-switch/SKILL.md",
20 + "-skills/java/java-record-patterns/SKILL.md",
21 + "-skills/java/java-scoped-values/SKILL.md",
22 + "-skills/java/java-security-manager-disabled/SKILL.md",
23 + "-skills/java/java-sequenced-collections/SKILL.md",
24 + "-skills/java/java-source-scripts/SKILL.md",
25 + "-skills/java/java-stream-gatherers/SKILL.md",
26 + "-skills/java/java-unnamed-variables-patterns/SKILL.md",
27 + "-skills/java/java-unsafe-memory-migration/SKILL.md",
28 + "-skills/java/java-virtual-threads/SKILL.md",
29 + "-skills/mdbook/SKILL.md",
30 + "-skills/niri/SKILL.md",
31 + "-skills/qml/SKILL.md",
32 + "-skills/quickshell/SKILL.md",
33 + "-skills/rust-maud/SKILL.md",
34 + "-skills/wezterm/SKILL.md",
35 + "-skills/luci-ci/SKILL.md",
36 + "-skills/chrome-cdp/SKILL.md",
37 + "-skills/firefox-bidi/SKILL.md",
38 + "-skills/x230/SKILL.md",
39 + "-skills/archlinux/SKILL.md",
40 + "-skills/ascii-boxes/SKILL.md",
41 + "-skills/jj/jj-bookmark-move/SKILL.md",
42 + "-skills/jj/jj-commit/SKILL.md",
43 + "-skills/jj/jj-review/SKILL.md",
44 + "-skills/jj/jj-sync/SKILL.md",
45 + "-skills/linux/SKILL.md",
46 + "-skills/linux-console/SKILL.md",
47 + "-skills/linux-userland/SKILL.md",
48 + "-skills/presenterm/SKILL.md",
49 + "-skills/security/SKILL.md",
50 + "-skills/terminal-harness/SKILL.md",
51 + "-skills/win32-drive/SKILL.md"
52 + ],
53 + "theme": "terminal",
54 + "defaultProvider": "openai-codex",
55 + "defaultModel": "gpt-5.6-luna",
56 + "defaultThinkingLevel": "high",
57 + "defaultTools": ["bash", "edit", "read", "write", "ls", "grep"],
58 + "horst": {
59 + "os": {
60 + "win32": {
61 + "tools": {
62 + "add": ["powershell"],
63 + "remove": ["bash"]
64 + }
65 + }
66 + }
67 + },
68 + "collapseChangelog": true,
69 + "editorPaddingX": 1,
70 + "tuiMode": "fullscreen",
71 + "fullscreenExitOutput": "resume-hint",
72 + "terminal": {
73 + "showTerminalProgress": true
74 + },
75 + "sessionDir": "~/.local/state/pi/sessions",
76 + "masks": {
77 + "pickerShortcut": "alt+m",
78 + "items": [
79 + {
80 + "name": "default",
81 + "model": "openai-codex/gpt-5.6-luna",
82 + "thinkingLevel": "high",
83 + "shortcut": "alt+0"
84 + },
85 + {
86 + "name": "glm-flash",
87 + "model": "zai/glm-5.3-flash",
88 + "thinkingLevel": "high",
89 + "shortcut": "alt+1"
90 + },
91 + {
92 + "name": "sol",
93 + "model": "openai-codex/gpt-5.6-sol",
94 + "thinkingLevel": "medium",
95 + "shortcut": "alt+2"
96 + },
97 + {
98 + "name": "astra",
99 + "model": "openai-codex/gpt-6-astra",
100 + "thinkingLevel": "high",
101 + "shortcut": "alt+3"
102 + },
104 + "name": "opus",
105 + "model": "klaus/claude-opus-5",
106 + "thinkingLevel": "high",
107 + "shortcut": "alt+4"
108 + },
110 + "name": "fable",
111 + "model": "klaus/claude-fable-5-1",
112 + "thinkingLevel": "high",
113 + "shortcut": "alt+5"
114 + },
116 + "name": "luna",
117 + "model": "openai-codex/gpt-5.6-luna",
118 + "thinkingLevel": "high"
119 + },
121 + "name": "glm",
122 + "model": "zai/glm-5.3",
123 + "thinkingLevel": "high"
124 + },
126 + "name": "qwen3.6",
127 + "model": "hetzner/Qwen/Qwen3.6-35B-A3B-FP8",
128 + "thinkingLevel": "off"
129 + },
131 + "name": "qwen3.8",
132 + "model": "hetzner/Qwen3.8-27B",
133 + "thinkingLevel": "medium"
136 + },
137 + "angel": {
138 + "thinkingLevel": "high",
139 + "subagentExtensions": [
140 + "pfui",
141 + "klaus",
142 + "fast",
143 + "rtk",
144 + "uv",
145 + "git-safe",
146 + "web"
147 + ],
148 + "pairs": [
150 + "executor": "openai-codex/gpt-5.6-sol",
151 + "advisor": "openai-codex/gpt-6-astra"
152 + },
154 + "executor": "openai-codex/gpt-5.6-terra",
155 + "advisor": "openai-codex/gpt-5.6-sol"
156 + },
158 + "executor": "openai-codex/gpt-5.6-luna",
159 + "advisor": "openai-codex/gpt-5.6-sol"
160 + },
162 + "executor": "klaus/claude-opus-5",
163 + "advisor": "klaus/claude-fable-5-1"
164 + },
166 + "executor": "zai/glm-5.3-flash",
167 + "advisor": "zai/glm-5.3"
170 + },
171 + "iq": {
172 + "judgeModel": "zai/glm-5.3",
173 + "stateDir": "~/Notes/LLMs",
174 + "counterJudgeModel": [
175 + "openai-codex/gpt-5.6-sol",
176 + "openai-codex/gpt-6-astra",
177 + "klaus/claude-fable-5-1",
178 + "klaus/claude-opus-5"
179 + ],
180 + "counterSampleRate": 0.25
181 + },
182 + "fast": {
183 + "enable": true
184 + },
185 + "ultra": {
186 + "auto_enable": true,
187 + "subagentExtensions": [
188 + "pfui",
189 + "klaus",
190 + "angel",
191 + "fast",
192 + "git-safe",
193 + "rtk",
194 + "uv",
195 + "web"
196 + ],
197 + "actionSummarizerModel": "openai-codex/gpt-5.6-luna",
198 + "modelTiers": {
199 + "tiny": {
200 + "model": "openai-codex/gpt-5.6-luna",
201 + "thinkingLevel": "minimal"
202 + },
203 + "small": {
204 + "model": "openai-codex/gpt-5.6-luna",
205 + "thinkingLevel": "high"
206 + },
207 + "medium": {
208 + "model": "openai-codex/gpt-5.6-terra",
209 + "thinkingLevel": "high"
210 + },
211 + "large": {
212 + "model": "openai-codex/gpt-6-sol",
213 + "thinkingLevel": "high"
214 + },
215 + "huge": {
216 + "model": "openai-codex/gpt-6-astra",
217 + "thinkingLevel": "high"
220 + },
221 + "goodJob": {
222 + "model": "openai-codex/gpt-5.5",
223 + "thinkingLevel": "medium"
224 + },
225 + "decay": {
226 + "model": "openai-codex/gpt-5.6.luna",
227 + "summarizerModel": "openai-codex/gpt-5.5"
228 + },
229 + "intellij": {
230 + "url": "http://127.0.0.1:64343/stream"
231 + },
232 + "hideThinkingBlock": false

quickshell/nuguland/.pi/skills/nuguland-ui/SKILL.md

Modified
6 6 # Nuguland UI
8 -## Read the actual contract
10 -1. Read the project's [AGENTS.md](../../../AGENTS.md) and [justfile](../../../justfile).
11 - Run project commands from `quickshell/nuguland`, not this skill directory.
12 -2. Load `qml` and `quickshell` for implementation, `gestalt` for visual organization, and `nugu` for palette changes.
13 -3. Read the relevant spec under the repository's `.system/specs/`.
14 - Popup work also follows the [popup interaction contract](../../../../../.system/specs/NL-SPEC-38AED50A-popup-interaction-language/index.md).
15 -4. Trace the changed control through its caller, state owner, shared surface, and service.
16 - Inspect `Theme.qml`, matching `Popup*.qml` controls, `SurfaceManager.qml`, and `PopoutHost.qml` before inventing another component or positioning rule.
18 8 ## Specify before drawing
20 -Record the primary user action and observable result.
21 -For each changed interaction, name its state owner, pending/success/failure feedback, focus entry and return, keyboard activation, and dismissal behavior.
22 -Cover empty, unavailable, disabled, selected, and long-content states where the feature has them.
23 -Identify supported output dimensions and scale from the target setup, not guessed constants.
10 +Primary user action. Observable result.
11 +Per changed interaction: state owner, pending/success/failure feedback, focus entry and return, keyboard activation, dismissal.
12 +States where the feature has them: empty, unavailable, disabled, selected, long content.
13 +Output dimensions and scale from the target setup, never guessed constants.
25 -For a layout decision, load `gestalt` and use `mockup` to compare one to four options.
26 -Use Nugu semantic roles and existing control language, not a new palette or decorative card system.
15 +Layout decisions: load `qml` and `quickshell`; palette work loads `nugu`.
16 +Compare one to four mockup options. Nugu semantic roles and existing control language only; no new palette, no decorative card system.
27 17 Iterate until accepted.
28 -A browser mockup approves design direction only; it does not prove QML geometry, fonts, input, or compositor behavior.
29 -Do not demand a new design review for an unchanged layout's logic-only fix.
18 +Mockup approval covers direction only. Not QML geometry, fonts, input, compositor behavior.
19 +No new design review for logic-only fixes of unchanged layouts.
31 21 ## Implement one complete interaction
33 -- Reuse shared controls and theme tokens.
34 - Introduce a primitive only when no existing control fits the requested role.
35 -- Keep one state owner and one geometry owner per axis.
36 - Bind state down, route user intent up, and do not navigate through `parent.parent`.
37 -- Provide meaningful accessible names, visible focus, and applicable keyboard activation.
38 - Keep hover, pressed, checked, disabled, and pending states distinguishable without color alone.
39 -- Group by task and relationship.
40 - Avoid equal-weight cards, badges, borders, and motion competing with the primary action.
41 -- Preserve lowercase authored labels, service ownership, and existing behavior outside the requested change.
42 -- Exercise the complete user action before expanding to the next component.
43 - A shared-control change requires checking its affected callers, not only a demonstration widget.
23 +- Shared controls and theme tokens. New primitive only when nothing fits.
24 +- Bind state down, route intent up. No `parent.parent`.
25 +- Accessible names, visible focus, keyboard activation.
26 + Hover, pressed, checked, disabled, pending distinguishable without color.
27 +- Group by task and relationship. No equal-weight cards, badges, borders, or motion competing with the primary action.
28 +- Lowercase labels, service ownership, existing behavior outside the change stay.
29 +- Exercise the full action before the next component.
30 + Shared-control changes check all affected callers, not a demo widget.
45 -## Validate without touching the live desktop
32 +## Validate
47 -Use `just test` and `just lint` for automated gates.
48 -Use `just fmt` for formatting and `just build` when shader sources change, then rerun lint.
49 -Inspect the recipes first: the current lint runtime check can ping the live shell or launch one when absent.
50 -Do not let that fallback launch against the parent desktop during UI validation.
51 -Run it in the isolated test environment when a fresh load is needed.
34 +Fixture per change: `controls`, `popouts`, `privilege`, `noko`, `system`, `tasks`, `niri`, `all`.
35 +Add one when the behavior is uncovered.
53 -Run `just ui-test` for the existing shared-control fixture and inspect its emitted evidence directory.
54 -It verifies `PopupButton`, `PopupSlider`, and `PopupTextField` with synthetic state, not every popup or live service.
55 -Add a fixture for the changed feature when that behavior is not covered.
56 -Do not improvise parent-session commands or pretend `just lint` supplies interaction proof.
37 +The lint runtime check may ping or launch a live shell. Never on the parent desktop; fresh loads run isolated.
58 -Use Quickshell's generated `.qmlls.ini` for Qt6 language-server support and keep it gitignored.
59 -`PanelWindow` resolution is an upstream-documented static-tooling limitation, not justification for fabricated metadata or new warning suppressions.
39 +Inspect the emitted evidence directory: bounded readiness waits, complete stdout/stderr, screenshots at target geometry.
40 +Short recording when stills cannot establish transient behavior.
41 +Evidence lives in the relevant spec's evidence directory: command, versions, geometry, expected/observed.
61 -The nested runner must:
63 -- Start `niri`, never `niri-session`, with a dedicated test config and no live-session autostarts.
64 -- Identify the child Wayland display, runtime directory, and niri IPC socket explicitly.
65 - Refuse pointer, keyboard, screenshots, or IPC actions if their target is not the child.
66 -- Isolate D-Bus and relevant services or use fixture-backed service state.
67 - Nesting the compositor alone does not isolate audio, networking, notifications, credentials, or system-bus mutations.
68 -- Use synthetic data for sensitive UI.
69 - Do not unlock a real vault, prompt real PAM, change host networking, or claim session-lock ownership on the parent.
70 -- Wait for observable readiness with bounded timeouts; retain complete stdout/stderr.
71 -- Clean up only child processes and artifacts it created, never parent desktop processes or pre-existing research files.
73 -## Evidence required for changed behavior
75 -Drive the real QML surface with pointer and keyboard inside the nested session.
76 -Use the existing driver; load `terminal-harness` if controlling an interactive terminal program.
77 -For each relevant case, assert the visible result and resulting fixture/service state:
79 -- Open, close, reopen; Escape and outside click; correct focus entry and return.
80 -- Tab/Shift+Tab traversal and applicable Enter/Space/arrow-key activation.
81 -- Pointer activation, hover, press, drag, scroll, and secondary buttons where supported.
82 -- Async success/failure and external state updates while open, without duplicate writes or stale controls.
83 -- Empty/unavailable content, long labels, overflow, and supported output sizes/scales.
84 -- Affected shared-control callers retain their existing actions and state feedback.
86 -Capture and inspect actual QML screenshots at target geometry for the changed states.
87 -Check clipping, alignment, hierarchy, spacing, readability, focus, and state feedback against the approved direction.
88 -Use a short recording for transient behavior when still images cannot establish it.
89 -Keep evidence in the relevant spec's evidence directory with command, versions, target geometry, and expected/observed outcomes.
90 -Never include sensitive content in screenshots or logs.
92 -Report static, load, interaction, and visual results separately.
93 -Source regexes establish source conventions only.
94 -An IPC ping establishes reachability only.
95 -A clean startup establishes loading only.
96 -Missing rendered or interaction evidence remains an explicit blocker.
43 +`.qmlls.ini`: Quickshell generates it. Tooling details in the nested-harness README.

quickshell/nuguland/.system/MISSION.md

Added
new file mode 100644
1 +# MISSION
3 +A desktop shell an agent can extend correctly from public contracts alone, without reading host internals first, and prove it loaded, driven, and rendered.

quickshell/nuguland/.system/RULES.md

Added
new file mode 100644
1 +# RULES
3 +## Commands
5 +The justfile is the source of truth. Public API only:
7 +- `just lint`
8 +- `just test` (accepts a stem, e.g. `just test audio`; `vault-native` runs the Rust suite)
9 +- `just ui-test` (accepts a named fixture and an optional `WIDTHxHEIGHT`)
10 +- `just fmt`
11 +- `just build`
13 +- Run commands from `quickshell/nuguland`.
14 +- Never test by restarting or killing the parent niri session.
15 +- Never execute `niri-session`; it ignores `--help` and can terminate the live desktop session. Inspect its source instead.
16 +- Keep pointer, keyboard, `wdotool`, `wtype`, and screenshot proofs inside nested niri via `just ui-test`.
17 +- Never launch `test-fixtures/ui/refactor.qml` or `niri-integration.qml` directly; their sandbox service substitutions are mandatory.
19 +## Gates
21 +Zero warnings, isolated evidence, reviewed pixels. Rigor over velocity claims.
23 +- Zero warnings: `just lint` fails on any non-disabled `qmllint` warning (`MaxWarnings=0`) and on missing, stale, or orphan shader blobs.
24 +- Never disable `qmllint`, `shellcheck`, `shfmt`, `qmlformat`, shader freshness, runtime shader fallback, `.qmltypes`, import paths, or any lint/test step, and never exclude files from them, without explicit human approval.
25 +- No `|| true`, output filters, allowlists, or warning downgrades.
26 +- All UI labels are lowercase.
28 +## Shaders
30 +- Research prior art online first (Shadertoy, Qt/QML examples, compositor shaders, demoscene); adapt it to Nugu semantics and budgets; document the inspiration in comments.
31 +- Sources live in `shaders/*.frag`; `just build` compiles the checked-in `*.frag.qsb`; runtime never compiles shaders and degrades cleanly when a blob is missing.
33 +## UI work
35 +- Load `.pi/skills/nuguland-ui/` before creating, changing, or reviewing UI.
36 +- Reuse `Theme.qml` and shared `Popup*.qml`; read their callers before changing shared behavior.
37 +- Popup work follows `NL-SPEC-38AED50A`.
38 +- Feature onboarding follows `NL-SPEC-A7K4QX2M`.
40 +## Evidence levels
42 +Static, load, interaction, and visual proof are separate; report them separately.
44 +- Static: lint, unit tests, formatting, shader freshness. Proves nothing about loading or rendering.
45 +- Load: run the entry point or fixture in isolation; inspect complete stdout and stderr.
46 +- Interaction: real pointer and keyboard inside nested niri — activation, Tab and arrows, Escape, outside dismissal, focus entry and return, external updates, empty and unavailable states.
47 +- Visual: rendered screenshots at target geometry, reviewed by a human. A screenshot is evidence, not approval.
49 +An IPC ping proves reachability only. Source regexes prove source conventions only.
51 +## Nested-fixture diagnostic exceptions
53 +Owner-approved 2026-09-06, `niri.log` only:
55 +- at most one exact `niri::backend::winit` DEBUG record for the software EGL render-node fallback, full multiline match including the `EGL_EXT_device_drm` cause;
56 +- exactly one exact `niri::niri` WARN `ENOENT` for the deliberate `/evidence/missing-directory/native-failure.png` write, inside the measured action interval.
58 +Duplicates, missing records, wrong source, severity, cause, out-of-interval timing, or occurrence in any other log fail the run. All other diagnostics stay strict; raw logs are never filtered or rewritten.
60 +## Docs
62 +- `.system/` cores and specs are agent authority; read RULES and the relevant spec before governed work.
63 +- READMEs are human overview; agent-only knowledge belongs in `.system/`.

quickshell/nuguland/.system/SYSTEM.md

Added
new file mode 100644
1 +# SYSTEM
3 +## Nuguland
5 +Quickshell 0.3.1 desktop shell for niri, inside the dorkfiles repo. One long-lived QML process per session: `ShellRoot`, services, per-screen windows, feature surfaces.
7 +QML domain truths:
9 +- bindings are reactive; imperative assignments destroy them;
10 +- implicit size flows from children to parents, actual size from parents to children;
11 +- one mutable state owner per concern, one geometry owner per axis;
12 +- services live outside per-screen `Variants` unless duplication is intended;
13 +- a `Loader` item does not exist before creation; state that survives reload belongs to a longer-lived owner;
14 +- `PanelWindow` cannot be resolved by static tooling; that is an upstream limitation, not breakage.
16 +Ownership split, invariant:
18 +- **service** — native integrations, system state, subprocesses, typed properties, intent methods; never geometry or focus.
19 +- **model** — pure transformations; testable without QML or compositor.
20 +- **panel** — presentation, local cursor and focus state, intent emission, every content state.
21 +- **host** — surface creation, placement, lifecycle, focus entry and return, dismissal, animation policy, injection; never feature rendering or feature service logic.
23 +Registration, binding target: one typed QML registry entry per feature covers service, panel, bar control, sizing data, and fixture name. IPC handlers stay explicit and typed in `shell.qml`. The registry is typed QML, never runtime JSON. Geometry data lives in entries; generic geometry computation stays in the host. Lock and privilege keep specialized controllers; the popup host is a default, not a universal lifecycle.
25 +Boundaries: typed `required property` injection across components; JSON only at IPC and diagnostics edges; startup composition only.
27 +## Docs hierarchy
29 +This System, RULES, and the specs under `.system/specs/` are authority.
30 +READMEs are human overview and carry no binding rules.
32 +## Non-goals
34 +No plugin marketplace, no capability facades, no new theme system, no distribution model, no weakening of isolation or proof.

quickshell/nuguland/.system/board.json

Added
new file mode 100644
1 +{
2 + "schemaVersion": 0,
3 + "items": {}
4 +}

quickshell/nuguland/.system/config.json

Added
new file mode 100644
1 +{
2 + "prefix": "NL",
3 + "schemaVersion": 0,
4 + "title": "nuguland",
5 + "currentPhase": "NL-PHASE-NHO6XZIJ"
6 +}

quickshell/nuguland/.system/phases/NL-PHASE-NHO6XZIJ-architecture-revamp/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PHASE-NHO6XZIJ
3 +type: phase
4 +title: Architecture revamp
5 +label: arch-revamp
6 +---
8 +# Architecture revamp
10 +Sub-mission: make public-contract onboarding the default mode of change in Nuguland. Governing contract `NL-SPEC-A7K4QX2M`; rollout `NL-PLAN-C4V7TQ2X`.
12 +## Priorities
14 +1. Locality: one registration site, feature-local slices.
15 +2. Proof rigor: zero warnings, isolated nested evidence, reviewed pixels.
16 +3. Owner judgement on recorded metrics over velocity.
17 +4. Minimal churn per slice; no big-bang rewrite.
19 +## Decision defaults
21 +| Concern | Default |
22 +| --- | --- |
23 +| Locality vs rigor | Rigor wins |
24 +| New features | Registry contract from day one |
25 +| Existing features | Migrate slice-wise, one named fixture at a time |
26 +| Activation | Startup composition only |
27 +| Internal state API | JSON stays until the typed follow-up decides |
28 +| Lock/auth | Specialized controllers, never the popup lifecycle |
29 +| Gates | Never weakened to make an iteration green |
31 +## Non-goals
33 +Plugin ecosystem; user configuration; runtime activation; repository-wide rewrite.
35 +## Exit criteria
37 +- [ ] One registry entry plus feature-local files is the entire wiring for an ordinary feature.
38 +- [ ] OSD onboarded by a second agent from public contracts alone.
39 +- [ ] Owner continuation judgement recorded against baseline metrics.
40 +- [ ] All gates green throughout: lint, JS suite, ui-test.

quickshell/nuguland/.system/plans/NL-PLAN-0AC08B83-brightness-popup-initial-redesign/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-0AC08B83
3 +type: plan
4 +title: Brightness popup initial redesign
5 +spec: NL-SPEC-FDA339B0
6 +status: approved
7 +---
9 +# Brightness popup initial redesign
11 +This plan covers the approved initial redesign only.
12 +The later transactional DDC contract remains unplanned.
14 +1. Extend pure brightness shaping and tests for real display rows, controllability, and global none, synced, and mixed state.
15 +2. Extend the brightness service with live output state, display and global state, and an explicit user-triggered setup action.
16 +3. Replace the panel with setup-only behavior when unavailable, global and preset controls when available, and independent display rows.
17 +4. Route global, preset, and per-display interactions through the service interfaces.
18 +5. Run targeted brightness tests, formatting, the zero-warning lint gate, and accepted-mockup visual review.
20 +Exit when real-display behavior works without fake controls and all listed checks pass.

quickshell/nuguland/.system/plans/NL-PLAN-0D15DD3E-nuguland-orientation-rollout/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-0D15DD3E
3 +type: plan
4 +title: Nuguland orientation rollout
5 +spec: NL-SPEC-0B9CBD34
6 +status: approved
7 +---
9 +# Nuguland orientation rollout
11 +1. **Orientation interface**
12 + Add one shell-owned orientation value, public set and toggle operations, geometry reads, and the compositor binding.
13 + Preserve existing IPC JSON fields.
14 +2. **Compact formatting**
15 + Centralize the abbreviation rule and expose its pure self-test.
16 + Exit when all required cases pass.
17 +3. **Bar layout**
18 + Thread orientation through the bar, switch anchors and flow, derive vertical thickness from content, compact vertical workspace labels, and render the stacked clock without overlap.
19 + Exit when registered geometry proves both layouts.
20 +4. **Popout geometry**
21 + Thread orientation and bar thickness through placement and outside-dismiss handling.
22 + Exit when both orientations open, clamp, and dismiss correctly.
23 +5. **Review**
24 + Verify live toggling, clean logs, geometry reads, horizontal regression behavior, and visual legibility.

quickshell/nuguland/.system/plans/NL-PLAN-0E85CD00-deliver-read-only-caldav-calendar/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-0E85CD00
3 +type: plan
4 +title: Deliver read-only CalDAV calendar
5 +spec: NL-SPEC-9D4A99C2
6 +status: approved
7 +---
9 +# Deliver read-only CalDAV calendar
11 +1. **Parsing and layout core**
12 + Provide runtime-neutral calendar parsing and multi-day segmentation.
13 + Test unfolding, decoding, dates, tasks, malformed input, week wrapping, and lane allocation.
14 +2. **Calendar service interface**
15 + Own non-secret configuration, status, events, calendars, refresh, setup, self-test, and additive state behind one injected service.
16 +3. **Discovery and fetch**
17 + Discover event and task calendars with read-only DAV requests.
18 + Expand events server-side, leave VTODO unexpanded, and filter dated tasks to the visible window.
19 + Keep credentials outside arguments, logs, responses, and persistent configuration.
20 +4. **Lifecycle integration**
21 + Inject the service through the shell and expose state and refresh IPC.
22 + Refresh after configuration load, every 15 minutes, and when the clock popup opens.
23 +5. **Month grid**
24 + Render the Monday-first 42-day grid with lowercase weekdays, today and spillover treatment, dots, pills, and calendar colors.
25 +6. **Multi-day bands**
26 + Render week-split segments with reserved lanes and verify deterministic week wrapping.
27 +7. **Agenda and stale state**
28 + Order today's all-day items and tasks before timed events.
29 + Support scrolling, empty state, last-good data, and stale indication.
30 +8. **Setup and keyring handoff**
31 + Add lowercase URL, username, app-password, and save controls with explicit app-password guidance.
32 + Validate fields, store through the keyring boundary, clear transient secret state, and show inline failures safely.
33 +9. **Verification**
34 + Run parser and service checks.
35 + Validate startup, additive IPC, live discovery and fetch, offline behavior, keyring failure, credential non-disclosure, and required screenshots.

quickshell/nuguland/.system/plans/NL-PLAN-2CA16D60-nuguland-companion-shell-rollout/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-2CA16D60
3 +type: plan
4 +title: Nuguland companion shell rollout
5 +spec: NL-SPEC-86A037A0
6 +status: approved
7 +---
9 +# Nuguland companion shell rollout
11 +1. **Foundation**
12 + Establish the named shell, composition-root service injection, Nugu semantics, public IPC, diagnostics, and graphical-session service.
13 + Keep incumbent frontends authoritative until live checks pass.
14 +2. **Bar core**
15 + Add the primary-output bar, all-output workspace state, workspace actions, and clock.
16 + Exit when geometry, updates, and safe show or hide checks pass.
17 +3. **Status services**
18 + Add media, connectivity, resources, audio, brightness, and battery state through native services or bounded adapters.
19 + Exit when values match independent system readings and every interaction is verified.
20 +4. **Companion surfaces**
21 + Add tray, clipboard, bind-mode state, calendar, idle inhibition, and confirmed power interactions.
22 + Exit when popouts are readable, keyboard accessible, and destructive paths remain gated.
23 +5. **Native notifications**
24 + Transfer notification ownership under a rollback guard.
25 + Verify urgency, timeout, actions, history, dismissal, and do-not-disturb behavior.
26 + Exit when one daemon owns the bus and rollback is proven.
27 +6. **Cutover**
28 + Run parse, lint, interaction, visual, service, and process checks.
29 + Remove live references to replaced frontends only after parity evidence and human approval.

quickshell/nuguland/.system/plans/NL-PLAN-5E808493-deliver-notification-surfaces-and-lifecycle/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-5E808493
3 +type: plan
4 +title: Deliver notification surfaces and lifecycle
5 +spec: NL-SPEC-C49F734E
6 +status: approved
7 +---
9 +# Deliver notification surfaces and lifecycle
11 +1. **Notification identity**
12 + Introduce ID-keyed replacement preserving read state and row order.
13 + Cover it through the service self-test.
14 +2. **Toast lifecycle**
15 + Track active toast snapshots separately from history.
16 + Define eligibility, expiry, transient handling, critical behavior, reference cleanup, and dismissal.
17 + Expose active toasts additively through state and IPC.
18 +3. **Shared card**
19 + Provide full and compact modes with icon resolution, images, dismissal, actions, and advertised reply.
20 +4. **Popup surface**
21 + Render grouped, scrollable full cards with lowercase notification controls.
22 + Remove debug labels, drag handling, and masked action rails.
23 +5. **Toast surface**
24 + Render compact cards in a non-focus-stealing primary-screen overlay.
25 + Preserve independent lifetimes across model rebuilds and sticky critical behavior.
26 +6. **Compositor route**
27 + Bind the reserved shortcut to toast dismissal and verify the IPC target end to end.
28 +7. **Service cleanup**
29 + Remove drag IPC and telemetry only after proving no live consumers remain.
30 +8. **Verification**
31 + Run isolated and real-notification checks covering replacement, transient handling, expiry, DND, critical persistence, actions, images, scrolling, and shortcuts.
32 + Verify both card modes and inspect logs after cache-clean restarts.

quickshell/nuguland/.system/plans/NL-PLAN-7AB0F679-nugu-desktop-theme-rollout/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-7AB0F679
3 +type: plan
4 +title: Nugu desktop theme rollout
5 +spec: NL-SPEC-83056D8D
6 +status: approved
7 +---
9 +# Nugu desktop theme rollout
11 +1. **Generator boundary**
12 + Produce deterministic dark and light color-only artifacts from the Nugu palette.
13 + Exit when generation and palette validation pass for both modes.
14 +2. **Runtime state and command boundary**
15 + Provide mode selection, toggle, current-mode preparation, and read-only status against XDG state.
16 + Exit when invalid-state fallback and side effects match the spec.
17 +3. **Consumer adapters**
18 + Connect desktop preference, compositor, Nuguland, and enabled mode-aware consumers without moving layout or behavior into runtime theme state.
19 + Exit when every enabled consumer updates safely.
20 +4. **Startup integration**
21 + Materialize required runtime artifacts before consumers start without mutating tracked configuration.
22 + Exit when service and cold-start checks pass.
23 +5. **Contract verification**
24 + Run generator checks, both transitions, desktop-preference assertions, repository-diff invariance, and human visual review.
25 + Exit only when the full round trip passes without a tracked change.

quickshell/nuguland/.system/plans/NL-PLAN-C19E2C04-power-popup-two-zone-redesign/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-C19E2C04
3 +type: plan
4 +title: Power popup two-zone redesign
5 +spec: NL-SPEC-C24FF4FA
6 +status: approved
7 +---
9 +# Power popup two-zone redesign
11 +1. Add tested battery-presence shaping distinguishing desktop placeholders from real main batteries.
12 +2. Expose battery presence without changing session routing or confirmation behavior.
13 +3. Replace the equal-weight panel with an optional battery hero, external-device chips, the complete safe-action group, and a separate danger region.
14 +4. Replace the danger region with in-place confirm and cancel controls while a destructive action is pending.
15 +5. Preserve Enter-to-confirm and Escape-to-cancel behavior.
16 +6. Run power shaping tests, formatting, the zero-warning lint gate, and visual checks for battery-present and battery-absent states.
18 +Exit when desktops show no fake battery, every safe action remains available, destructive actions remain gated, and the two-zone layout is verified.

quickshell/nuguland/.system/plans/NL-PLAN-C4V7TQ2X-nuguland-agent-revamp/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-C4V7TQ2X
3 +type: plan
4 +title: Nuguland agent revamp rollout
5 +spec: NL-SPEC-A7K4QX2M
6 +status: draft
7 +---
9 +# Nuguland agent revamp rollout
11 +```mermaid
12 +flowchart LR
13 + p1["1 prerequisites · recursive discovery"] --> p2["2 audio + OSD pilot · registry live"]
14 + p2 --> p3{"3 independent onboarding"}
15 + p3 -->|owner: continue| p4["4 broader migration"]
16 + p3 -->|owner: stop| stop["revert convention"]
17 + p4 --> p5["5 typed state APIs"]
18 + p2 --> p6["6 load-test target"]
19 + p4 --> p6
20 +```
22 +Baseline metrics are recorded before phase 1 starts: central files touched by one audio change, context files required, registration points, iterations to green.
24 +1. **Prerequisites**
25 + Fold agent law into `.system/`, remove the folded sources, extend justfile QML and test discovery to recurse into `features/` without weakening any gate.
26 + Exit when zero-warning lint and the full suite pass with recursive discovery.
27 +2. **Audio + OSD pilot**
28 + Move audio and OSD sources, tests, and fixtures into `features/`. Introduce the typed QML registry covering their wiring. Move per-feature sizing data out of `SurfaceManager` into entries; keep generic computation. Registry-driven instantiation replaces the audio popup case and inline component in `PopoutHost`. State APIs stay JSON.
29 + Exit when every existing gate stays green: lint, full JS suite, `just ui-test` audio and OSD flows.
30 +3. **Independent onboarding proof**
31 + Freeze the registry contract and the audio feature as reference. A second agent onboards OSD using public contracts only: `.system/`, registry, audio reference. Record central-file edits, required context files, contract gaps, and iterations.
32 + Exit when the owner reviews the evidence and decides continue, adjust, or stop.
33 +4. **Broader migration**
34 + Migrate remaining features onto the registry one slice at a time, each with its named fixture. Decompose `SurfaceManager` and `PopoutHost` further only where migration proves the need. Specialized surfaces register their controller kind without adopting the popup lifecycle.
35 + Exit when each migrated feature passes its named fixture and the full gate.
36 +5. **Typed internal service APIs**
37 + Separate follow-up: replace internal `stateJson()` consumption with typed readonly properties or QML models where practical; rewrite affected fixture doubles; keep JSON at IPC and diagnostics boundaries. The "where practical" criterion is defined in that follow-up.
38 + Exit when affected panels and fixtures pass unchanged interaction and visual evidence.
39 +6. **Feature-local test commands**
40 + `just test <stem>` and `just ui-test <fixture>` already exist and stay canonical. Add the named `load-test` target for the load evidence level. No second test system.
41 + Exit when `just load-test <feature>` runs the isolated load check for every registry entry.

quickshell/nuguland/.system/plans/NL-PLAN-F85F4593-deliver-event-driven-audio-state/index.md

Added
new file mode 100644
1 +---
2 +id: NL-PLAN-F85F4593
3 +type: plan
4 +title: Deliver event-driven audio state
5 +spec: NL-SPEC-FEE98E07
6 +status: approved
7 +---
9 +# Deliver event-driven audio state
11 +1. **Media contract**
12 + Derive media energy only from playback state.
13 + Remove state descriptions claiming waveform or peak-history input.
14 +2. **Audio service**
15 + Remove peak-monitor ownership, level properties, smoothing state, and periodic smoothing.
16 + Preserve PipeWire tracking, controls, stream rows, and privacy state.
17 + Derive activity from active links and mute state.
18 +3. **State interfaces**
19 + Remove deleted amplitude concepts while preserving unrelated audio, media, privacy, and IPC behavior.
20 +4. **Static verification**
21 + Confirm no stale peak-monitor, level, smoothing, or amplitude references remain.
22 + Run audio service checks.
23 +5. **Runtime verification**
24 + Restart with a clean QML cache and inspect logs and IPC.
25 + Exercise volume, mute, device selection, and microphone privacy.
26 +6. **Resource verification**
27 + Confirm no shell-owned peak stream exists, the idle sink can suspend, and idle CPU improves against the recorded baseline.

quickshell/nuguland/.system/specs/NL-SPEC-0B9CBD34-nuguland-bar-orientation/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-0B9CBD34
3 +type: spec
4 +title: Nuguland bar orientation
5 +---
7 +# Nuguland bar orientation
9 +## Behavior
11 +- The bar has one global orientation: `horizontal` or `vertical`.
12 +- The default is `horizontal`.
13 +- The orientation interface accepts either orientation or `toggle` and returns the resulting orientation.
14 +- Unknown input is a no-op returning the current orientation.
15 +- Changes apply live and remain consistent across bar and popout geometry.
17 +## Layout
19 +| Concern | Horizontal | Vertical |
20 +| --- | --- | --- |
21 +| Edge | top | left |
22 +| Span | full width | full height |
23 +| Thickness | fixed bar height | widest visible compact content |
24 +| Flow | left to right | top to bottom |
25 +| Clock | inline hour and minute | stacked hour, rule, minute |
26 +| Popouts | below the bar | right of the bar |
28 +- The clock remains the middle zone and never overlaps another bar zone.
29 +- Vertical workspace pills remain compact and use the widget-label abbreviation rule.
30 +- OSD and toast placement remains independently top-right.
31 +- Orientation transitions are immediate.
33 +## Abbreviation contract
35 +Drop `a`, `e`, `i`, `o`, and `u`, then take the first three characters.
36 +If fewer than three characters remain, take the first three characters of the original label.
38 +| Input | Output |
39 +| --- | --- |
40 +| `notify` | `ntf` |
41 +| `code` | `cod` |
42 +| `media` | `med` |
43 +| `system` | `sys` |
44 +| `audio` | `aud` |
45 +| `power` | `pwr` |
47 +## Popout constraints
49 +- Bar thickness is the only orientation-dependent offset shared with popout geometry.
50 +- Vertical popouts use the free area to the right, move rightward, and clamp on the y-axis.
51 +- Horizontal popouts use the free area below, move downward, and clamp on the x-axis.
52 +- The outside-dismiss region excludes the bar in both orientations.
54 +## Acceptance
56 +- Horizontal chips share a y-axis and vertical chips share an x-axis in increasing order.
57 +- Vertical thickness follows content rather than a fixed width.
58 +- The abbreviation self-test passes every required case.
59 +- Registered clock geometry does not overlap another bar zone.
60 +- Popout state reports the correct origin, constrained axis, and transition direction.
61 +- Outside dismissal does not intercept bar clicks.
62 +- Returning to horizontal preserves existing behavior.
63 +- The compositor keybind toggles orientation.
64 +- A human confirms labels, clock, and separator remain legible.

quickshell/nuguland/.system/specs/NL-SPEC-37DAB33A-system-popup/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-37DAB33A
3 +type: spec
4 +title: System popup
5 +---
7 +# System popup
9 +## Behavior
11 +- The popup shows machine identity and live resources, then the top five CPU consumers, followed by current issues and recent incidents.
12 +- Identity includes host, model, distribution, kernel, window manager, package count, shell, uptime, and battery facts when available.
13 +- Live statistics include CPU, memory, swap, temperature and fan when available, network, disk, and load.
14 +- Metrics use graphical fill bars and bounded sparklines rather than a terminal aesthetic.
15 +- Cheap metrics refresh about every two seconds.
16 +- Expensive disk, failed-service, and process checks run about every five seconds only while open.
17 +- Identity and update checks are cached and refreshed on open or infrequently.
18 +- Issues cover failed services, thermal state, low disk, memory with growing swap, battery health, updates, and load relative to core count.
19 +- Current conditions are severity-ordered under `needs attention`; recorded crashes and OOM kills are newest-first under `incident history`.
20 + History rows use neutral cards and subdued clock icons, never warning/error card emphasis, because a past event does not establish a current failure.
21 + Current failures retain their severity styling; history retains counts, times, open/`arrrgh` actions, and existing journal-window expiry.
22 + No acknowledgment/dismissal state is added and no journal entries or coredumps are deleted.
23 + Dispatch errors remain visibly actionable even on neutral history rows.
24 +- Repeated crashes with the same exact executable path and UID share one row, showing occurrence count and the latest crash time.
25 + Missing or lossy executable/UID identity leaves crashes separate; different applications/users and OOM events never merge.
26 + Groups are derived from retained journal records without dismissal state or additional persistence, and keep stable IDs as occurrences enter or leave the retained window.
27 + Groups are newest-first by their latest occurrence; the header counts records, not rows.
28 + The existing open action inspects the latest crash, while `arrrgh` receives every retained occurrence in the selected group, including exact boot/cursor/time and bounded metadata.
29 + Pending, error/retry, keyboard focus/reveal, and close-on-dispatch remain owned by the existing resource service and popup controls.
30 +- Incidents are limited to journal-visible records in the current boot and last 24 hours, up to the latest 100 matching records.
31 + Missing records do not imply that no application crashed; unavailable or incomplete history is explicit and retains last-good data.
32 +- Failed services, thermal conditions, disk/memory/load pressure, crashes, and OOM kills have an `arrrgh` button with the Nerd Font pirate icon and `assess and diagnose with pi` tooltip.
33 + Available updates and battery wear have no agent action, including at the dispatch boundary.
34 + Existing open actions remain available, including the update action.
35 +- App/service identity leads each row in emphasized text; issue type and metadata are secondary, with relative and local calendar times for incidents.
36 + Untrusted metadata is plain text, never markup.
37 +- `arrrgh` starts a fresh interactive Pi session in a new WezTerm window rooted at `$XDG_STATE_HOME/nuguland/repairs/`.
38 + Missing or relative `XDG_STATE_HOME` falls back to `~/.local/state`; the working directory stays stable across issues and sessions.
39 + Launch preflight creates the directory privately if absent, preserves existing contents and permissions, and refuses dispatch when it is unusable.
40 + The shared prompt lives in `quickshell/nuguland/prompts/system-repair.md`, not global agent configuration.
41 + Exactly one literal `{{context}}` slot receives JSON facts: issue identity/type/severity, observation time, machine identity, relevant measurements, service-manager scopes, and incident boot/time/cursor/process metadata.
42 + It contains no prescribed diagnostic commands, inferred cause, raw journal payloads, environment dumps, or core memory.
43 + The agent selects its own diagnostic tools.
44 + The template is read asynchronously on each launch; missing or malformed templates block dispatch with an error instead of reusing stale instructions.
45 + Each launch saves a private, uniquely named `.request-*.md` prompt snapshot in the repair directory and passes it to Pi as an `@file` argument.
46 + This preserves every retained occurrence even when the prompt exceeds Linux's per-argument size limit; write failures block dispatch with a visible retryable error.
47 + Request snapshots are repair evidence, never widget state, and earlier snapshots are not overwritten.
48 +- The prompt requires per-issue Markdown reports under `issues/` inside the stable repairs directory.
49 + Reports identify the exact issue and machine, and append dated attempts without replacing history.
50 + They contain the problem, evidence-backed root cause, attempted solutions and outcomes, verified fix, verification steps/results, learnings/prevention, blockers, and next steps.
51 + Only verified successful fixes are marked resolved; unsuccessful or partially verified attempts remain unresolved.
52 + Reports exclude secrets and raw sensitive logs; the agent verifies saving and reports the log path/status or save failure.
53 + Report writing is a prompt obligation, not an automatic resolution detector.
54 +- The shared instruction is to assess, diagnose, and recommend or apply an appropriate remedy, not to force a fix for every warning.
55 + Monitoring, no change, or a recommendation can be justified outcomes; an already-gone incident is not an invented successful repair.
56 +- Diagnosis comes first; privileged, destructive, package, service restart, and desktop-session changes require explicit human approval.
57 + This is a prompt constraint, not a new OS sandbox or permission mechanism.
58 +- Resource service owns dispatch state: pending disables duplicate launches, missing Pi/WezTerm leaves a visible error and retry, dispatch closes the popup to release keyboard focus.
59 + Dispatch means a launch request, not proof that Pi or its provider initialized successfully.
60 +- Pointer, Tab/Shift+Tab, Enter/Space, Escape, outside dismissal, and reopen retain the shared popup contract.
61 +- Empty current conditions and empty incident history have separate lowercase status rows.
63 +## Constraints
65 +- The popup remains smooth on the target ThinkPad X230.
66 +- Metric history is strictly bounded.
67 +- Closing the popup stops expensive probes.
68 +- Missing or failed data is shown as `n/a` or omitted and never creates a false issue.
69 +- Failed probes retain last-good data and do not crash the service.
70 +- Battery checks are skipped when no laptop battery exists.
71 +- Existing system-state IPC remains available with functional state only.
73 +## Issue thresholds
75 +- Failed services are errors.
76 +- Disk use at 90% is a warning and at 95% is an error.
77 +- Memory pressure requires at least 90% memory use and growing swap.
78 +- Battery health below 80% is a warning and below 60% is an error.
79 +- Thermal degradation is an error; crossing a sensor high threshold is at least a warning.
80 +- Available updates are informational.
82 +## Acceptance
84 +- Pure tests cover parsers, rate and ring behavior, formatting, thresholds, unavailable inputs, and action shaping.
85 +- Runtime self-test covers issue wiring and IPC shaping.
86 +- Nested-niri rendered screenshots and pointer/keyboard tests confirm identity and live cards, issue grouping, agent dispatch, failure/retry, long metadata, empty/unavailable history, and polling lifecycle.
87 +- Synthetic crash/OOM records and action-planner tests cover filtering, malformed data, stable identities, limits, service scopes, literal argv transport, and prompt safety.
89 +## Evidence
91 +[Agent actions and incident detection](evidence/arrrgh-2026-09-06/README.md).
92 +[Stable repair directory and issue reports](evidence/repair-log-2026-09-06/README.md).
93 +[Local repair prompt and eligible actions](evidence/repair-prompt-2026-09-06/README.md).
94 +[Repeated application crashes](evidence/crash-groups-2026-09-06/README.md).
95 +[Process line above issues](evidence/process-line-2026-09-06/README.md).
96 +[Neutral incident history](evidence/neutral-history-2026-09-06/README.md).

quickshell/nuguland/.system/specs/NL-SPEC-38AED50A-popup-interaction-language/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-38AED50A
3 +type: spec
4 +title: Nuguland popup interaction language
5 +---
7 +# Nuguland popup interaction language
9 +Follow-up: [UI/UX repair contract](ux-repair.md) and [repair progress with evidence](repair-progress.md).
11 +## Behavior
13 +- Every registered popup uses one common outer surface.
14 +- Matching UI roles use common sections, cards, buttons, toggles, separators, sliders, badges, and text fields.
15 +- Controls visibly distinguish hover, press, focus, selected or toggled, and disabled states.
16 +- Status is never communicated by color alone.
17 +- Cards provide large targets, visible status, and optional secondary detail.
18 +- Spacing and common regions provide grouping; dividers separate only unrelated groups.
19 +- All UI labels are lowercase.
20 +- Tray cards expose all nonempty documented metadata.
21 +- Tray left click activates, or opens the menu for menu-only items.
22 +- Tray right click opens an available native menu; middle click invokes secondary activation.
23 +- The launcher has no decorative bottom stripe.
24 +- Audio cards have no exposed left accent sliver.
26 +## Constraints
28 +- Service APIs remain stable except for specified notification and tray routes.
29 +- iwd remains the single Wi-Fi row and write authority.
30 +- No lockscreen, bar, palette, or dependency redesign is included.
31 +- Bespoke data visualization may remain bespoke.
32 +- Shared controls are keyboard accessible and expose appropriate accessibility roles and names.
34 +## Acceptance
36 +- DND, toast dismissal, Wi-Fi refresh and interaction, and all three tray pointer routes behave as specified.
37 +- Every registered popup uses the common surface and matching shared controls.
38 +- All popup labels are lowercase.
39 +- The full popup test suite and zero-warning lint gate pass.

quickshell/nuguland/.system/specs/NL-SPEC-38AED50A-popup-interaction-language/repair-progress.md

Added
new file mode 100644
1 +# UI/UX repair progress
3 +2026-09-06.
4 +Contract: [ux-repair.md](ux-repair.md).
5 +Evidence: [retained runs and visual review](evidence/ux-repair-2026-09-06/README.md).
7 +**The repair is not complete: DDC setup and the remaining acceptance gaps below are still open.**
8 +No features were deliberately removed.
9 +No parent desktop restart, real authentication, host network change, package installation, or new dependency was used.
10 +Unrelated dirty work remains untouched.
12 +## Implemented and exercised
14 +- Shared native-backed buttons, cards, sliders, fields, and styled tooltips provide pointer/keyboard activation, visible focus, disabled rejection, contextual names, bounded labels, and wrapped explanations.
15 + Nested controls cover exactly-once activation, thumb-grab stability, drag, external updates, and field-padding focus.
16 +- Hover no longer switches an active task.
17 + Explicit Bar activation switches panels; activating the same chip closes it.
18 + The vertical Bar accent remains a right-edge hairline rather than filling the Bar during orientation changes.
19 +- Shell-lifetime state retains clipboard and launcher queries/selections, panel disclosure, and scroll positions.
20 + Shared scroll restoration waits for rendered layout, not only Loader completion.
21 + Nested flows exercise close/reopen, switching, and orientation changes.
22 +- Clipboard commands preserve filtering and reactive updates.
23 + Pointer and keyboard paste close the real popup, verify native destination focus, and insert exactly once in a synthetic destination window.
24 + The focus-query Process exit signal is connected through `Connections`; a same-named method inside Process was inert.
25 +- Audio and brightness retain service bindings and stable interactive delegates.
26 + Nested flows cover live updates during audio drag, brightness updates after local pointer/keyboard changes, unavailable brightness controls, and keyboard scrolling through long audio lists.
27 +- Media capabilities disable unsupported controls.
28 + Tray primary, secondary, and menu routes are keyboard reachable.
29 + Power reboot/power-off confirmations cancel on switching and outside dismissal without executing destructive actions.
30 +- Connectivity preserves an expanded SSID and the same masked editor during live updates.
31 + Dismissal clears credential input while retaining ordinary disclosure state.
32 +- Notification replies are owned by service state.
33 + External updates and close/reopen preserve the draft; a failed send retains it with retryable feedback.
34 +- Noko capture start/stop supports pointer and keyboard.
35 + History copy reaches the native sandbox clipboard, keyboard traversal reveals focused rows, and reopening restores the actual history viewport.
36 +- Vault search supports keyboard selection reveal and clears stale detail on zero matches.
37 + Result selection and actual scroll position survive Loader recreation and orientation changes.
38 + Result/detail restoration is deferred until a rendered frame; checking retained service values alone missed a viewport reset.
39 +- Privilege prompts set initial focus without continually stealing it.
40 + Forward/reverse Tab traverse input, reveal, cancel, and authorize; rejection, masking, cancellation, and synthetic success remain covered.
41 +- Existing clock/system, Noko overlay, native Niri subscription/workspace/output, and native screenshot checks remain enabled and pass.
43 +## Compact power and empty-panel follow-up
45 +The accepted compact power layout and content-sized empty tray/media states are implemented and visually reviewed.
46 +Power keeps service-owned confirmation, contextual tooltips, and keyboard focus return.
47 +Empty tray/media resize live when service items disappear or return.
48 +[Final evidence](evidence/power-empty-2026-09-06/README.md) records zero-warning lint, 290 `all` assertions, and 152 task assertions at each configured resolution.
49 +The broader acceptance gaps below remain open.
51 +## Validation
53 +The following records the earlier broad repair run; the follow-up above contains the latest scoped evidence.
55 +Run serially from `quickshell/nuguland` after formatting:
57 +- `just fmt`: passed.
58 +- `just test`: passed.
59 +- `just lint`: passed, with zero warnings; includes JS, Rust, format, shader freshness, and the existing runtime gate.
60 +- `just ui-test all`: passed, 261 named interaction assertions at 1280×720, plus direct assertions and complete-log gates.
61 +- `just ui-test tasks 1366x768`: passed, 123 named interaction assertions, plus direct assertions.
62 +- `just ui-test tasks 2560x1440`: passed, 123 named interaction assertions, plus direct assertions.
63 +- `git diff --check -- .`: passed for the Nuguland working tree.
65 +Both configured sizes exercise horizontal and vertical bars at scale 1.
66 +The nested sandbox has a 300-second deadline because the expanded 2560×1440 software-rendered suite exceeded 180 seconds.
67 +Per-command and readiness timeouts remain 30 seconds; no check or diagnostic gate was disabled.
69 +Rendered review covered control states, tooltips, the task panels at both output sizes/orientations, masked/rejected privilege prompts, clock setup, populated resources, and native clipboard paste.
70 +It found and prompted repairs for the vertical Bar fill and the large-output viewport restoration race.
71 +The final vault/Noko screenshots show restored rows inside their actual viewports.
72 +Existing long titles are deliberately elided; overflowing lists scroll within their panels.
74 +Static tests establish logic/source contracts.
75 +Fresh nested runs establish loading and exercised interaction behavior.
76 +Screenshot inspection establishes only the rendered states actually reviewed.
77 +The live-shell lint IPC ping does not prove a fresh production configuration load.
79 +## Remaining blockers and acceptance gaps
81 +1. Inventory item 14 remains unimplemented: real DDC display detection/setup and a verified completion path.
82 + The brightness fixture proves UI behavior, not physical display control or privileged setup.
83 +2. Real vault authentication/MFA/reprompt, Wi-Fi/Bluetooth operations, audio routing/device profiles, media playback, CalDAV synchronization, and speech recognition were not exercised against live services.
84 + Synthetic success is not proof of those integrations.
85 +3. Not every action/state variant has nested coverage.
86 + Add focused fixtures for remaining backend-dependent controls and long-content variants, including Bluetooth pairing, vault setup/MFA/reprompt, the production screenshot popup, long agenda content, and many simultaneous resource issues.
87 + Native screenshot backend coverage does not cover the production screenshot popup.
88 +4. Physical multi-output changes and cross-monitor behavior remain unproven.
89 + Native output-query fixtures are not hardware hotplug tests.
91 +These gaps have not been reconciled with the owner as accepted exclusions.
92 +Do not mark the broad repair contract complete from the passing suites alone.

quickshell/nuguland/.system/specs/NL-SPEC-38AED50A-popup-interaction-language/ux-repair.md

Added
new file mode 100644
1 +# Nuguland UI/UX repair
3 +## Approved direction
5 +Retain every existing feature and the Nugu palette.
6 +Apply the compact, icon-led direction approved in mockup iteration 3.
7 +Use one control language across every widget.
8 +Remove filler subtitles and repetitive instruction labels, not useful status.
9 +Use icons for familiar secondary actions, with useful, Nugu-styled tooltips and accessible names.
10 +Keep primary actions explicit.
11 +Do not copy GNOME branding or Omarchy features into Nuguland.
13 +Reference principles:
15 +- [GNOME design principles](https://developer.gnome.org/hig/principles.html): task simplicity, progressive disclosure, reduced effort, consideration, accessibility.
16 +- [Omarchy Quattro navigation](https://github.com/basecamp/omarchy/blob/quattro/manual/04-navigation.md): complete keyboard operation and direct access.
17 +- [Omarchy Quattro panels](https://github.com/basecamp/omarchy/blob/quattro/manual/05-the-top-bar.md): long-running integrated shell, immediately useful panels, pointer and keyboard actions.
19 +Nuguland resolves conflicts in favor of conventional control traversal: Tab traverses controls, not adjacent panels.
20 +Hover never switches away from an active task.
21 +No new dependencies, feature removals, palette redesign, or parent-desktop testing.
23 +## State and lifecycle contract
25 +Ordinary search, selection, expanded sections, scroll positions and unsent replies belong to shell-lifetime in-memory state, not disposable Loader/delegate instances.
26 +Dismissal is not discard.
27 +Reopening or switching panels restores ordinary state.
28 +Successful completion or an explicit clear/discard action may clear its own state.
29 +Do not persist ordinary drafts to disk.
30 +Passwords and authorization state retain their explicitly defined security lifetimes.
31 +Do not blanket-cache every panel or credential.
32 +Destructive confirmation is cancelled on every dismissal or switch.
34 +Service-derived state remains reactive after local commands.
35 +Commands never replace a view's binding with a returned JSON snapshot.
36 +Live updates preserve row identity while dragging or editing.
37 +Clipboard actions preserve the current filter.
38 +Notification reply failure retains its draft and exposes a retryable outcome.
40 +## Interaction contract
42 +- Explicit activation opens or switches a popup; same-chip activation closes it.
43 +- Each task defines initial focus and returns focus when dismissed.
44 +- Search tasks focus their search editor immediately.
45 +- Escape, outside click and switching use the same lifecycle cleanup route.
46 +- Pointer and keyboard actions have the same meaning and visible feedback.
47 +- Holding activation keys does not repeatedly dispatch commands.
48 +- Tab and Shift+Tab reach all enabled actions without hovering.
49 +- Focused controls are visible, including action rails and notification dismissal.
50 +- Sliders preserve service bindings, full drag sequences and thumb geometry; each has a contextual accessible name.
51 +- Field padding and icon regions focus the editor; empty focused fields retain their hint.
52 +- Capabilities determine whether a control is enabled.
53 +- Async work exposes pending, success or actionable failure, without fabricating completion.
54 +- Clipboard paste must release popup focus and establish destination focus before typing.
55 +- Authentication controls support keyboard traversal without continuous focus theft; no real authentication in tests.
57 +## Visual contract
59 +Use consistent header hierarchy, spacing, radii, icon sizes, action roles and focus treatment.
60 +Neutral surfaces are quiet; primary action, selection, expansion, disabled and error states remain distinct.
61 +Do not border every nested content region.
62 +Status is never color-only.
63 +Tooltips use Nugu surfaces and typography, name the action or explain unavailable state, wrap long text and never show credentials.
64 +Keyboard focus can expose useful tooltips without requiring pointer hover.
65 +All authored labels and tooltip text are lowercase.
66 +Long content stays inside its available geometry and all actions remain reachable by scrolling or disclosure.
67 +Support configured 2560×1440 and 1366×768 outputs at scale 1, horizontal and vertical bars.
69 +## Source-confirmed repair inventory
71 +The initial audit is source evidence, not runtime proof.
73 +1. Loader disposal loses ordinary drafts and scroll state.
74 +2. Hover switching followed by clicking toggles the requested popup closed.
75 +3. Audio, brightness, media, clipboard, power and tray commands sever reactive state bindings.
76 +4. Snapshot array replacement recreates interactive delegates during live updates.
77 +5. Clipboard actions drop filtering; paste has no focus handoff.
78 +6. Hover-only actions and mouse-only rows block keyboard tasks.
79 +7. Custom controls lack standard focus/activation, accessible names, bounded labels and consistent slider geometry.
80 +8. Media exposes unsupported actions as enabled.
81 +9. Power dismissal retains armed destructive confirmation.
82 +10. Launcher details, tray lists and system issues can exceed clipped fixed-height content.
83 +11. Connectivity hides errors; refreshes can destroy the active credential editor.
84 +12. Vault keyboard selection can leave the viewport or retain details after zero matches.
85 +13. Privilege focus retry prevents normal traversal.
86 +14. Brightness DDC setup has no detected-display/completion route; full hardware behavior requires separate verified service work, not a cosmetic success label.
88 +## Acceptance and evidence
90 +Existing checks remain enabled.
91 +Run public `just test`, `just lint` and `just ui-test` gates.
92 +Use `just fmt` and rerun gates after formatting.
93 +Extend the existing nested-niri fixtures for changed flows, with isolated synthetic services.
94 +Do not claim that existing shared-control, Clock/System, Noko-overlay or native-Niri tests cover unexercised panels.
96 +For each repaired flow, record:
98 +- pointer and keyboard activation, disabled behavior and exactly-once writes;
99 +- edits and selection through close/reopen and switching;
100 +- external updates after a local action;
101 +- pending/failure/empty/long-content states;
102 +- actual rendered screenshots, reviewed for clipping, hierarchy, focus and state feedback;
103 +- tested output geometry, commands and retained complete logs.
105 +Track delivered slices and remaining blockers in `repair-progress.md`, not in SYSTEM.md or MISSION.md.
106 +Completion requires the entire inventory to be resolved or explicitly reconciled with the owner, not merely a passing control demonstration.

quickshell/nuguland/.system/specs/NL-SPEC-5F4166AF-audio-popup/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-5F4166AF
3 +type: spec
4 +title: Audio popup
5 +---
7 +# Audio popup
9 +## Behavior
11 +- The popup presents lowercase `output` and `input` sections backed by current PipeWire devices.
12 +- Each device row shows a speaker or microphone state glyph, device name, volume slider, and percentage from 0% through 150%.
13 +- Muted rows show a muted glyph and reduced emphasis.
14 +- Default devices use selected card border and fill without an exposed accent sliver.
15 +- Clicking or dragging a slider changes volume; middle click toggles mute.
16 +- Selecting a device name makes it the default output or input.
17 +- Empty sections remain valid.
18 +- The bar privacy indicator reports microphone and camera activity with a lowercase label.
20 +## Constraints
22 +- PipeWire remains the authoritative audio boundary.
23 +- Volume is clamped to 0 through 1.5.
24 +- Missing names use a stable fallback; missing default devices produce no selected row.
25 +- Existing audio, privacy, routing, and self-test IPC remains available.
26 +- State retains consumed sinks, sources, streams, default IDs, privacy, and action results.
27 +- State excludes backend narration and unused shader descriptions.
28 +- Existing stream routing remains available, but no new routing UI is required.
30 +## Acceptance
32 +- Pure tests cover volume boundaries, percentages, name precedence, mute and role state, privacy combinations, row shaping, glyphs, and ID lookup.
33 +- Runtime self-test passes.
34 +- Live checks confirm privacy, volume routes, sliders, mute, and default selection.
35 +- The popup uses shared controls and contains no audio card accent sliver.

quickshell/nuguland/.system/specs/NL-SPEC-7945430A-clipboard-popup/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-7945430A
3 +type: spec
4 +title: Clipboard popup
5 +---
7 +# Clipboard popup
9 +## Behavior
11 +- History is ordered with pinned items first, then newest capture.
12 +- Search matches title and body without changing that ordering.
13 +- Rows distinguish image, color, URL, path, and text content.
14 +- Image rows show bounded asynchronous thumbnails with an image-icon fallback.
15 +- Valid hex and RGB colors show a swatch; malformed colors remain text.
16 +- Each row shows a concise title plus lowercase kind and age metadata.
17 +- Copy, paste, pin, and delete are compact icon actions.
18 +- Actions may appear on hover but remain keyboard reachable.
19 +- Pinned rows have a non-color-only selected indication.
20 +- Private mode remains directly visible and prevents new captures.
21 +- History persists atomically and remains capped.
23 +## Constraints
25 +- Unreadable, binary, and oversized captures are ignored.
26 +- Malformed persisted history recovers to empty valid history without crashing.
27 +- Thumbnail failure does not remove access to an item or its actions.
28 +- Capture remains limited to the existing text watch and temporary image-path flow.
29 +- Existing clipboard and launcher-facing IPC remains available and stable.
30 +- State responses contain functional state, not view narration.
32 +## Acceptance
34 +- Pure checks cover readability, type detection, color parsing, image paths, ordering, filtering, age buckets, and row shaping.
35 +- Runtime self-test passes.
36 +- A live visual check confirms recency, thumbnails and fallback, swatches, type icons, private mode, and keyboard-reachable actions.

quickshell/nuguland/.system/specs/NL-SPEC-83056D8D-nugu-desktop-theme-switching/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-83056D8D
3 +type: spec
4 +title: Nugu desktop theme switching
5 +---
7 +# Nugu desktop theme switching
9 +## Contract
11 +- Nugu is the sole palette source for generated desktop themes.
12 +- Valid modes are `dark` and `light`.
13 +- Missing or invalid persisted state resolves to `dark`.
14 +- Public operations select either mode, toggle, report current status, or prepare runtime artifacts without reload.
15 +- Status reads effective mode without writes or reloads.
16 +- A mode change updates the desktop color-scheme preference and every enabled consumer supporting that mode.
17 +- Nuguland and all other mode-aware consumers observe the same effective mode.
19 +## Runtime state
21 +- Runtime state belongs under the Nugu directory in XDG state home.
22 +- Runtime artifacts contain palette-derived colors and styling only.
23 +- Layout, behavior, bindings, modules, and timeouts remain consumer-owned.
24 +- Runtime switching never edits tracked files or symlink targets inside the dotfiles repository.
26 +## Safety
28 +- Switching between modes and back leaves repository status unchanged.
29 +- Live updates preserve unrelated application and session state.
30 +- Consumer restart is allowed only when no reliable live-update path exists.
31 +- Retired consumers do not constrain runtime artifacts.
33 +## Acceptance
35 +- Missing and invalid state select `dark`.
36 +- Selection, toggle, preparation, and status have the specified effects.
37 +- Dark and light artifacts are deterministic and palette-derived.
38 +- Desktop preference consistently reflects the selected mode.
39 +- A complete light-to-dark round trip creates no dotfiles diff.
40 +- Enabled visual consumers are readable and consistent in both modes.
41 +- Final visual acceptance is human-confirmed.

quickshell/nuguland/.system/specs/NL-SPEC-86A037A0-nuguland-companion-shell/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-86A037A0
3 +type: spec
4 +title: Nuguland companion shell
5 +---
7 +# Nuguland companion shell
9 +## Outcome
11 +One named Nuguland shell owns the desktop companion UI.
12 +Compositor, session, idle, lock, clipboard-storage, and authorization primitives remain separate unless an approved replacement is safer and simpler.
14 +## Required surfaces
16 +- One bar appears on the configured primary output and represents workspaces from all relevant outputs.
17 +- The bar exposes workspace navigation, clock and calendar, media, notifications, tray, resources, audio, brightness, connectivity, clipboard, launcher, idle inhibition, and power controls.
18 +- Popouts expose full interaction and dismiss predictably by outside click or Escape.
19 +- Native notifications provide urgency, actions, history, dismissal, and do-not-disturb behavior without a competing daemon.
20 +- Launcher and clipboard surfaces support keyboard navigation, selection, Escape dismissal, and empty states.
21 +- OSD and capture actions report success or failure without changing underlying action semantics.
22 +- Destructive session actions require confirmation.
23 +- Lock and suspend preserve safe ordering and the session lock boundary.
25 +## Interface constraints
27 +- Public IPC is stable at the behavior level.
28 +- Existing state JSON contracts evolve additively.
29 +- External command boundaries are narrow, explicit, and inspectable.
30 +- Shared services enter components through the shell composition root, not hidden global state.
31 +- All UI labels are lowercase.
33 +## Visual constraints
35 +- Nugu semantic roles are the visual source of truth.
36 +- Active controls use focus semantics, hover uses accent semantics, muted content uses minor semantics, and failures use warning or error semantics.
37 +- IBM Plex Sans is the UI font.
38 +- IBM Plex Mono is used for fixed-width status or numeric alignment.
39 +- Components remain usable in both Nugu modes.
41 +## Migration and safety
43 +- Replacement surfaces reach functional and visual parity before incumbent frontends retire.
44 +- Notification ownership changes under a proven rollback guard and never intentionally leaves two daemons competing.
45 +- Security-sensitive agents and lock behavior remain until separately specified and approved.
46 +- Retirement removes live references and service enablement.
47 +- Package removal is separate scope.
49 +## Acceptance
51 +- The shell starts through the graphical-session service without QML errors or warnings.
52 +- Every visible control passes its interaction matrix, including failure paths.
53 +- Workspace state updates without polling helpers.
54 +- Destructive actions cannot execute without confirmation.
55 +- Exactly one notification daemon owns the notification bus.
56 +- No retired frontend remains on a live configuration path.
57 +- Dark and light visual checks pass when theme switching is enabled.
58 +- The shell remains recoverable through a documented service rollback.

quickshell/nuguland/.system/specs/NL-SPEC-8EQ0TRBZ-nuguland-vault-widget/index.md

Added
new file mode 100644
1 +---
2 +schemaVersion: 0
3 +id: NL-SPEC-8EQ0TRBZ
4 +type: spec
5 +title: Nuguland vault widget
6 +---
8 +# Nuguland vault widget
10 +## Outcome
12 +A Nuguland bar widget provides the small daily Vaultwarden surface Oliver needs:
13 +search, inspect, reveal, copy, open, favorite, and use TOTP codes without opening a full vault client.
15 +The widget follows the [Nuguland popup interaction language](../NL-SPEC-38AED50A-popup-interaction-language/index.md).
17 +## Behavior
19 +- Activating the vault widget opens a split popout with search and results on the left and the selected item's details on the right.
20 +- Search covers the vault's useful item metadata and updates results while typing.
21 +- Keyboard and pointer input can search, move selection, activate actions, and dismiss the popout.
22 +- A global Niri shortcut opens the popout from any workspace and focuses search.
23 +- When a browser is focused, exact origin matches are promoted using its locally observed address; a manual query remains authoritative.
24 +- Context shortcuts copy the selected item's username, password, current TOTP, or next TOTP when available.
25 +- Successful copies provide transient field-specific feedback without displaying the copied value.
26 +- Favorites appear in a distinct group before all other matching items.
27 +- An item can be favorited or unfavorited from its detail view.
28 +- Closing and reopening restores the query, selected item, result scroll position, detail scroll position, expanded sections, and reveal state.
29 +- Retained state survives popout closure, not vault locking or shell termination.
30 +- Loading, empty, locked, authentication-failure, sync-failure, stale-cache, and unavailable-vault states are explicit and actionable.
31 +- Opening requests a sync without blocking usable encrypted cached data during network loss.
33 +## Unlock and configuration
35 +- One named profile selects the server URL, account identifier, and nonsecret behavior settings.
36 +- First use shows a calendar-style setup form for server URL and account; neither has a hardcoded default.
37 +- The settings action locks the vault before editing; cancel leaves the saved profile unchanged.
38 +- Saving validates the profile in the native boundary before persisting nonsecret JSON through Quickshell.
39 +- Changing server or account clears retained state and selects separate encrypted-cache, credential-storage, and favicon namespaces.
40 +- The required deployment targets `https://vault.bugabinga.net`; the same profile shape also targets official Bitwarden.
41 +- Credentials, tokens, master passwords, and derived keys are never configuration values.
42 +- Locking, suspend, and restart clear decrypted keys and in-memory access tokens, not the saved server login.
43 +- Refresh credentials and account-bound wrapped unlock material persist only in Secret Service.
44 +- A saved login unlocks locally with the master password, then syncs using refreshed access credentials without repeating email verification.
45 +- A missing cache can be rebuilt from the saved login without repeating second-factor authentication.
46 +- Transport failures preserve the saved login and usable cached data; definitive refresh rejection clears the saved login and locks the vault until interactive reauthentication.
47 +- Refreshed credentials are persisted before their access token is used; missing or unavailable protected storage is never replaced by plaintext storage.
48 +- Locked state shows only profile identity, cache freshness, and an in-widget master-password field.
49 +- Submitting sends the master password once to the isolated native vault boundary, then immediately clears the field.
50 +- The master password is never retained as UI state; only derived keys survive until timeout or lock.
51 +- Invalid input is cleared before another attempt.
52 +- Server-required login and second-factor challenges remain inside the locked flow and never expose vault metadata.
53 +- Closing the popout hides, rather than cancels, authentication; the challenge, selected method, and unsubmitted verification-code draft survive reopening in memory.
54 +- Closing still clears master-password and re-prompt inputs; explicit cancel, lock, timeout, suspend, and shell exit clear the pending authentication state.
55 +- Selecting email verification shows an inline inbox instruction and focuses the code field; it does not claim email delivery confirmation.
56 +- Submitting a verification code clears its draft immediately and shows a pending state until the native response arrives.
58 +The local `Quickshell.statePath("vault.json")` file uses this nonsecret profile shape.
59 +This example is not a default:
61 +```json
63 + "name": "personal",
64 + "serverUrl": "https://vault.example.com",
65 + "account": "user@example.com",
66 + "unlockTimeoutSeconds": 900,
67 + "clipboardTimeoutSeconds": 30
69 +```
71 +`serverUrl` accepts HTTPS Vaultwarden deployments or `https://vault.bitwarden.com` for official Bitwarden.
72 +Timeout values are seconds.
74 +## Item details
76 +- Every item type returned by Vaultwarden is usable, including login, secure note, card, identity, and SSH key items.
77 +- Standard and custom fields are shown with their names, values, sensitivity, and applicable actions intact.
78 +- Textual values can be copied.
79 +- Sensitive values are concealed by default and have separate reveal and copy actions.
80 +- URL values can be opened through the desktop portal or copied.
81 +- Attachments and unsupported field actions are identified without hiding the rest of the item.
82 +- URL-bearing items use a cached favicon; absent or failed favicons fall back to an item-type icon.
83 +- Icon-only actions have tooltips, accessible names, and visible hover, press, and keyboard-focus states.
85 +## TOTP
87 +- Items with TOTP show the current code, next code, and remaining time.
88 +- Clicking either code copies that displayed code.
89 +- At rollover, current and next advance together without changing selection or focus.
90 +- Items without TOTP omit the TOTP region.
92 +## Constraints
94 +- Vault content is read-only except for favorite state.
95 +- Vault access runs through a process-isolated native Rust boundary owned by Nuguland.
96 +- The unforked official Bitwarden Rust SDK supplies cryptography and reusable models/APIs, subject to this spec's security and behavior constraints.
97 +- Nuguland's native boundary implements only missing request/response handling required by this spec; item metadata must not be silently discarded.
98 +- `rbw` is reference material, including [PR #319](https://github.com/doy/rbw/pull/319), not a library dependency or maintained fork.
99 +- Nuguland-written cryptographic implementations remain forbidden.
100 +- Desktop integration uses native Wayland, Linux, and Quickshell APIs; X11 and Xwayland are not dependencies.
101 +- Node runtimes, `bw` and `rbw` CLI executables, `rbw-agent`, browser extensions, and persistent standalone daemons are not runtime dependencies.
102 +- Quickshell owns presentation and retained navigation state; the native boundary owns authentication, cryptography, sync, encrypted cache, and browser-context inspection.
103 +- Creating, editing, deleting, sharing, autofill, password generation, and vault administration are outside scope.
104 +- Configured Vaultwarden or Bitwarden account and lock boundaries remain authoritative.
105 +- Locked state exposes no item metadata or secrets.
106 +- Master passwords never enter process arguments, environment variables, logs, retained properties, or persistent storage.
107 +- Decrypted values, retained UI state, search terms, and copied secrets are never logged or persisted to disk.
108 +- Persistent cache contains only Bitwarden-encrypted vault payloads; authentication material uses protected credential storage.
109 +- Explicit copies are the only path from vault secrets to the system clipboard.
110 +- Secret copies do not enter Nuguland clipboard history and require no Niri clipboard changes.
111 +- Secret clipboard values expire after a short interval, but clearing never overwrites a subsequently changed clipboard.
112 +- Browser context uses local Linux accessibility and session interfaces; browser extensions and remote-debugging protocols are outside scope.
113 +- The observed browser address is neither persisted nor sent across the network.
114 +- Offline data remains encrypted at rest; no decrypted offline cache is introduced.
115 +- Favicon retrieval and caching disclose no vault contents to third-party favicon aggregators.
116 +- All visible labels are lowercase and both Nugu modes remain usable.
118 +## Accepted design
120 +[Open the accepted split-view mockup](vault-widget.html).
121 +[Open the accepted in-widget unlock mockup](vault-unlock.html).
123 +The search/result pane remains visible beside the detail pane.
124 +Favorites are grouped first, URL-bearing items use cached favicons, and actions use icons rather than text labels.
125 +The detail pane adapts to every Vaultwarden item type.
126 +Locked state replaces vault content with the integrated master-password flow.
128 +## Acceptance
130 +- First use, save, reload, edit, cancel, invalid settings, and failed persistence work without a tracked account profile.
131 +- Profile changes lock immediately, wait for native cleanup, and cannot reuse another identity's cache or late favicon results.
132 +- The configured profile connects to `vault.bugabinga.net` without embedding credentials in Nuguland configuration.
133 +- The same behavior contract passes against an official Bitwarden profile without UI changes.
134 +- Locked state reveals no item metadata and accepts the master password inside the widget.
135 +- Submit, cancel, invalid input, timeout, explicit lock, suspend, and shell exit leave no master password in UI state, arguments, environment, logs, or disk.
136 +- On-disk inspection finds no decrypted item values or plaintext authentication material.
137 +- Dependency and runtime inspection confirms no `rbw` library, Node runtime, `bw` or `rbw` CLI executable, `rbw-agent`, or standalone vault daemon dependency.
138 +- Desktop flows pass in a native Wayland session without Xwayland or an X11 server.
139 +- Search finds representative items of every supported type and selection updates the detail pane.
140 +- The Niri shortcut opens and focuses the widget from every workspace.
141 +- A focused browser promotes exact origin matches through the Linux-native route; unavailable browser context leaves retained state unchanged.
142 +- Context shortcuts copy each available target and report success without revealing its value.
143 +- Favorite toggling immediately moves matching items into or out of the favorites group and remains correct after vault sync.
144 +- Every supported item type exposes all available standard and custom fields without leaking concealed values.
145 +- Current and next TOTP values match independent generation before, during, and after a rollover; clicking each copies the shown value.
146 +- Query, selection, both scroll positions, expanded sections, and reveal state are unchanged after close and reopen.
147 +- Locking clears retained vault state and removes all item metadata and secrets from the surface.
148 +- Favicon cache hit, miss, failure, and fallback behavior work without third-party favicon aggregation.
149 +- Secret copy actions bypass Nuguland clipboard history, expire conditionally, and never overwrite newer clipboard content.
150 +- Cached vault items remain usable during network loss, while sync freshness and failures remain visible.
151 +- URL opening uses the desktop portal.
152 +- Pointer and keyboard flows, locked and failure states, both theme modes, and zero-warning lint pass.

quickshell/nuguland/.system/specs/NL-SPEC-8EQ0TRBZ-nuguland-vault-widget/vault-unlock.html

Added
new file mode 100644
1 +<!doctype html>
2 +<html lang="en">
3 +<head>
4 +<meta charset="utf-8">
5 +<meta name="viewport" content="width=device-width, initial-scale=1">
6 +<title>nuguland vault unlock</title>
7 +<style>
8 +* { box-sizing: border-box; }
9 +body { margin: 0; background: #121212; }
10 +.vault {
11 + --bg: #121212;
12 + --panel: #242424;
13 + --panel2: #303030;
14 + --text: #ededed;
15 + --muted: #9d9d9d;
16 + --line: #ffffff38;
17 + --accent: #d86dd8;
18 + --focus: #9aabae;
19 + width: min(920px, 96vw);
20 + height: 580px;
21 + margin: 14px auto;
22 + padding: 14px;
23 + border: 1px solid var(--line);
24 + border-radius: 14px;
25 + background: var(--panel);
26 + color: var(--text);
27 + font: 14px/1.25 "IBM Plex Sans", sans-serif;
28 + display: grid;
29 + grid-template-columns: 335px 1fr;
30 + overflow: hidden;
32 +button, input { font: inherit; color: inherit; }
33 +button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
34 +.browser { padding-right: 14px; border-right: 1px solid var(--line); min-width: 0; }
35 +.search { height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 13px; font-family: "IBM Plex Mono", monospace; font-size: 16px; color: var(--muted); }
36 +.lockedlist { height: 450px; display: grid; place-items: center; color: var(--muted); font: 12px "IBM Plex Mono", monospace; }
37 +.detail { display: grid; place-items: center; padding: 24px; }
38 +.unlock { width: min(390px, 100%); text-align: center; }
39 +.lock { width: 66px; height: 66px; margin: 0 auto 18px; border: 1px solid #d86dd870; border-radius: 18px; background: #d86dd810; display: grid; place-items: center; color: var(--accent); }
40 +.lock svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
41 +.unlock h1 { font-size: 25px; margin: 0 0 7px; }
42 +.account { color: var(--muted); font: 12px/1.5 "IBM Plex Mono", monospace; margin-bottom: 24px; }
43 +.pwrow { height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: grid; grid-template-columns: 1fr auto auto; align-items: center; padding-left: 13px; gap: 6px; }
44 +.pw { width: 100%; border: 0; outline: 0; background: transparent; font: 15px "IBM Plex Mono", monospace; }
45 +.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: pointer; margin-right: 5px; }
46 +.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
47 +.go { background: var(--accent); color: var(--bg); border-color: var(--accent); }
48 +.go:hover { color: var(--bg); filter: brightness(1.1); }
49 +.svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
50 +.hint { margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.45; }
51 +.status { margin-top: 27px; padding-top: 13px; border-top: 1px solid #ffffff20; color: var(--muted); font: 11px "IBM Plex Mono", monospace; }
52 +.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
53 +</style>
54 +</head>
55 +<body>
56 +<main class="vault">
57 + <section class="browser">
58 + <input class="search" aria-label="search vault" placeholder="search vault" disabled>
59 + <div class="lockedlist">unlock to search vault</div>
60 + </section>
61 + <section class="detail">
62 + <div class="unlock">
63 + <div class="lock"><svg viewBox="0 0 24 24"><rect x="4" y="10" width="16" height="11" rx="3"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></div>
64 + <h1>unlock vault</h1>
65 + <div class="account">vault.bugabinga.net<br>personal account</div>
66 + <div class="pwrow">
67 + <input class="pw" type="password" aria-label="master password" placeholder="master password" autofocus>
68 + <button class="iconbtn" aria-label="show master password" title="show master password"><svg class="svg" viewBox="0 0 24 24"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
69 + <button class="iconbtn go" aria-label="unlock vault" title="unlock vault"><svg class="svg" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></svg></button>
70 + </div>
71 + <div class="hint">the password is sent once to the isolated native vault process, then cleared from the widget</div>
72 + <div class="status"><span class="dot"></span>encrypted cache ready · last sync 8m ago</div>
73 + </div>
74 + </section>
75 +</main>
76 +</body>
77 +</html>

quickshell/nuguland/.system/specs/NL-SPEC-8EQ0TRBZ-nuguland-vault-widget/vault-widget.html

Added
new file mode 100644
1 +<!doctype html>
2 +<html lang="en">
3 +<head>
4 +<meta charset="utf-8">
5 +<meta name="viewport" content="width=device-width, initial-scale=1">
6 +<title>nuguland vault widget</title>
7 +<style>
8 +* { box-sizing: border-box; }
9 +body { margin: 0; background: #121212; }
10 +.vault {
11 + --bg: #121212;
12 + --panel: #242424;
13 + --panel2: #303030;
14 + --text: #ededed;
15 + --muted: #9d9d9d;
16 + --line: #ffffff38;
17 + --accent: #d86dd8;
18 + --focus: #9aabae;
19 + width: min(920px, 96vw);
20 + height: 580px;
21 + margin: 14px auto;
22 + padding: 14px;
23 + border: 1px solid var(--line);
24 + border-radius: 14px;
25 + background: var(--panel);
26 + color: var(--text);
27 + font: 14px/1.25 "IBM Plex Sans", sans-serif;
28 + display: grid;
29 + grid-template-columns: 335px 1fr;
30 + overflow: hidden;
32 +button, input { font: inherit; color: inherit; }
33 +button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
34 +.browser { padding-right: 14px; border-right: 1px solid var(--line); min-width: 0; overflow: hidden; }
35 +.search { height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 13px; font-family: "IBM Plex Mono", monospace; font-size: 16px; }
36 +.sectionlabel { color: var(--muted); font: 11px "IBM Plex Mono", monospace; margin: 13px 3px 5px; }
37 +.results { display: grid; gap: 4px; }
38 +.item { width: 100%; height: 55px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; padding: 7px 8px; display: grid; grid-template-columns: 36px 1fr 25px; gap: 9px; align-items: center; cursor: pointer; }
39 +.item:hover { background: #ffffff0b; }
40 +.item.on { background: #d86dd81c; border-color: #d86dd875; }
41 +.favicon { width: 34px; height: 34px; border-radius: 8px; background: #ededed; object-fit: contain; padding: 5px; }
42 +.typeicon { width: 34px; height: 34px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--accent); font: 16px "IBM Plex Mono", monospace; }
43 +.title { font-weight: 600; }
44 +.meta { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
45 +.pin { color: var(--accent); font-size: 15px; text-align: center; }
46 +.detail { padding: 5px 4px 0 22px; min-width: 0; overflow: hidden; }
47 +.head { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 12px; height: 51px; }
48 +.head .favicon { width: 48px; height: 48px; border-radius: 12px; padding: 7px; }
49 +.head h1 { font-size: 23px; margin: 0; }
50 +.head p { margin: 4px 0 0; color: var(--muted); font: 12px "IBM Plex Mono", monospace; }
51 +.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: pointer; font-size: 17px; }
52 +.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
53 +.totp { margin-top: 18px; padding: 15px; border: 1px solid #d86dd870; border-radius: 12px; background: #d86dd810; display: grid; grid-template-columns: 1fr 135px; gap: 16px; }
54 +.label { color: var(--muted); font: 11px "IBM Plex Mono", monospace; margin-bottom: 7px; }
55 +.code { border: 0; background: transparent; padding: 0; text-align: left; font: 700 34px/1 "IBM Plex Mono", monospace; letter-spacing: 5px; cursor: pointer; }
56 +.code:hover { color: var(--accent); }
57 +.hint { color: var(--muted); font-size: 11px; margin-top: 8px; }
58 +.next { border-left: 1px solid var(--line); padding-left: 16px; }
59 +.next .code { font-size: 18px; letter-spacing: 2px; }
60 +.count { margin-top: 10px; color: var(--accent); font: 12px "IBM Plex Mono", monospace; }
61 +.fields { display: grid; gap: 7px; margin-top: 15px; }
62 +.field { height: 55px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 8px 9px 8px 12px; min-width: 0; }
63 +.value { font: 14px "IBM Plex Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
64 +.actions { display: flex; gap: 5px; }
65 +.subtle { font-size: 12px; color: var(--muted); margin-top: 11px; }
66 +.svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
67 +</style>
68 +</head>
69 +<body>
70 +<main class="vault">
71 + <section class="browser">
72 + <input class="search" aria-label="search vault" placeholder="search vault">
73 + <div class="sectionlabel">favorites</div>
74 + <div class="results">
75 + <button class="item on"><img class="favicon" src="https://github.com/favicon.ico" alt=""><span><span class="title">github</span><span class="meta">login · oliver@bugabinga.net</span></span><span class="pin">★</span></button>
76 + <button class="item"><img class="favicon" src="https://codeberg.org/assets/img/favicon.svg" alt=""><span><span class="title">codeberg</span><span class="meta">login · bugabinga</span></span><span class="pin">★</span></button>
77 + </div>
78 + <div class="sectionlabel">all items</div>
79 + <div class="results">
80 + <button class="item"><span class="typeicon">▣</span><span><span class="title">daily card</span><span class="meta">card · visa ending 4242</span></span><span></span></button>
81 + <button class="item"><span class="typeicon">◎</span><span><span class="title">oliver jan krylow</span><span class="meta">identity · personal</span></span><span></span></button>
82 + <button class="item"><span class="typeicon">≡</span><span><span class="title">recovery codes</span><span class="meta">secure note</span></span><span></span></button>
83 + <button class="item"><span class="typeicon">⌁</span><span><span class="title">vcs deploy</span><span class="meta">ssh key · ed25519</span></span><span></span></button>
84 + </div>
85 + </section>
86 + <section class="detail">
87 + <header class="head">
88 + <img class="favicon" src="https://github.com/favicon.ico" alt="">
89 + <div><h1>github</h1><p>login · personal</p></div>
90 + <button class="iconbtn" aria-label="unpin favorite" title="unpin favorite">★</button>
91 + </header>
92 + <section class="totp">
93 + <div><div class="label">current code</div><button class="code" title="copy current code">824 193</button><div class="hint">click code to copy</div></div>
94 + <div class="next"><div class="label">next</div><button class="code" title="copy next code">391 420</button><div class="count">18s remaining</div></div>
95 + </section>
96 + <section class="fields">
97 + <div class="field">
98 + <div><div class="label">username</div><div class="value">oliver@bugabinga.net</div></div>
99 + <div class="actions"><button class="iconbtn" aria-label="copy username" title="copy username"><svg class="svg" viewBox="0 0 24 24"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3"/></svg></button></div>
100 + </div>
101 + <div class="field">
102 + <div><div class="label">password</div><div class="value">••••••••••••••••</div></div>
103 + <div class="actions">
104 + <button class="iconbtn" aria-label="view password" title="view password"><svg class="svg" viewBox="0 0 24 24"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
105 + <button class="iconbtn" aria-label="copy password" title="copy password"><svg class="svg" viewBox="0 0 24 24"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3"/></svg></button>
106 + </div>
107 + </div>
108 + <div class="field">
109 + <div><div class="label">website</div><div class="value">github.com</div></div>
110 + <div class="actions">
111 + <button class="iconbtn" aria-label="open website" title="open website"><svg class="svg" viewBox="0 0 24 24"><path d="M14 3h7v7M10 14 21 3M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"/></svg></button>
112 + <button class="iconbtn" aria-label="copy website" title="copy website"><svg class="svg" viewBox="0 0 24 24"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3"/></svg></button>
113 + </div>
114 + </div>
115 + </section>
116 + <div class="subtle">additional fields continue below · selected item and position survive close/open</div>
117 + </section>
118 +</main>
119 +</body>
120 +</html>

quickshell/nuguland/.system/specs/NL-SPEC-9D4A99C2-read-only-caldav-calendar/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-9D4A99C2
3 +type: spec
4 +title: Read-only CalDAV calendar
5 +---
7 +# Read-only CalDAV calendar
9 +## Outcome
11 +The clock popup shows the current six-week month grid and today's agenda from one Nextcloud CalDAV account.
12 +It remains useful offline and before setup.
14 +## Data behavior
16 +- Event and task calendars are discovered rather than hardcoded; disabled calendars are excluded.
17 +- Recurring events arrive expanded by the server.
18 +- Task queries are not recurrence-expanded because expansion can drop VTODO data.
19 +- The fetched window covers all 42 visible Monday-first cells.
20 +- Timed values become local display times from UTC instants.
21 +- All-day values remain calendar dates without timezone conversion.
22 +- Folded lines, escaped text, exclusive all-day end dates, timed events, and dated tasks parse defensively.
23 +- Invalid records are skipped without discarding valid records; undated tasks are ignored.
25 +## Presentation
27 +- Timed single-day events render as calendar-colored dots; all-day events render as pills.
28 +- Multi-day events render as non-overlapping bands split at week boundaries.
29 +- Today is emphasized and adjacent-month days are subdued.
30 +- Weekday labels are lowercase `m d m d f s s`, with weekends dimmed.
31 +- Today's agenda lists all-day items and tasks before timed events.
32 +- Open tasks use `○`, completed tasks are subdued, and timed events show local time.
33 +- Empty agenda text is `keine termine`.
34 +- The grid has a fixed six-row height and remains borderless, without gradients, shadows, or animation.
36 +## Setup, refresh, and failure
38 +- Initial setup collects a server URL, username, and app-password.
39 +- Setup explicitly says to use an app-password, not the main password.
40 +- Non-secret configuration and discovered metadata persist across restarts.
41 +- Data refreshes on initial load, when the popup opens, and every 15 minutes.
42 +- Missing configuration or credentials presents lowercase setup affordances.
43 +- Network, authentication, keyring, or parse failure never breaks the clock or grid.
44 +- Failure preserves last-good data and shows a subtle stale marker.
45 +- Keyring failure produces an inline, lowercase, actionable error.
47 +## Security and contracts
49 +- Calendar access permits DAV discovery and reads only.
50 +- The app-password is stored in the system keyring.
51 +- The password is never persisted in calendar configuration, written to disk, placed in process arguments, logged, or returned through IPC.
52 +- Transient password state is cleared after successful storage.
53 +- Additive IPC exposes status, non-secret account identity, counts, and setup booleans, never credentials.
55 +## Acceptance
57 +- Parser and layout checks cover unfolding, escaping, dates, tasks, malformed input, week wrapping, and overlapping lanes.
58 +- Service checks cover discovery, timezone-independent windows, setup drafts, and state serialization.
59 +- A live read discovers calendars and returns events and dated tasks without credential exposure.
60 +- Offline and missing-keyring tests preserve the shell and show the specified state.
61 +- Screenshots verify grid, bands, agenda ordering, stale state, setup guidance, and lowercase labels.
63 +## Out of scope
65 +- Month navigation or day selection.
66 +- Calendar mutation, multiple accounts, client-side recurrence, or cross-restart event caching.
67 +- Undated tasks, subtasks, and calendar alarms.

quickshell/nuguland/.system/specs/NL-SPEC-A7K4QX2M-nuguland-agent-onboarding/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-A7K4QX2M
3 +type: spec
4 +title: Nuguland agent onboarding architecture
5 +---
7 +# Nuguland agent onboarding architecture
9 +Binding contract for feature-oriented Nuguland. Rollout order lives in `NL-PLAN-C4V7TQ2X`.
10 +Primary outcome: an agent that has never seen this shell onboards a complete feature from public contracts only. Host internals are never a prerequisite; if onboarding cannot proceed without them, that is a contract gap and gets recorded as one.
12 +## Problem
14 +The shell is a single composition root with injected services, but wiring is central: one feature change fans out across host, bar, catalog, service wiring, and fixtures. The cost is not file length, it is change fanout — how many unrelated places must stay consistent for one feature. Agents also pay a context tax reading host internals before every edit, and dynamic `stateJson()` snapshots hide the internal API shape from tooling. Strict proof surfaces more failures than looser projects; that honesty stays.
16 +## Baseline
18 +Verified against the pre-revamp tree:
20 +| Symptom | Evidence |
21 +| --- | --- |
22 +| Flat tree | ~90 QML/JS files at root |
23 +| Central composition | `shell.qml` 1366 lines, ~20 `IpcHandler` functions |
24 +| Bar feature knowledge | `Bar.qml` 845 lines |
25 +| Central popup selection | `PopoutHost.qml`: 13-case switch, 14 inline `Component`s |
26 +| Feature sizing in host | `SurfaceManager.qml`: `heightBudget`, `batteryHeight`, per-feature empty heights |
27 +| Descriptive-only catalog | `popoutCatalog.js` authors no registration |
28 +| Hidden contracts | panels parse `stateJson()` into `var panelState` |
30 +## Adopted and rejected conventions
32 +Distilled from the Omarchy `quattro` comparison; Nuguland keeps its isolation and proof, adopts locality:
34 +| Adopted | Rejected |
35 +| --- | --- |
36 +| Feature directories as unit of work | Plugin marketplace, third-party distribution |
37 +| Conventional entry points | Dynamic capability facades |
38 +| One registration site | Runtime JSON manifests |
39 +| Shared panel lifecycle by default | Broad `var` service APIs |
40 +| Separately testable model logic | UI-owned native service integrations |
41 +| Named per-feature tests | Mixing service ownership with presentation |
43 +## Architecture
45 +```mermaid
46 +flowchart TB
47 + root["shell.qml · startup composition, typed IPC"]
48 + registry["typed QML registry · one entry per feature"]
49 + host["host · SurfaceManager + PopoutHost"]
50 + subgraph featuredir ["features/name/"]
51 + svc["service"]
52 + model["model"]
53 + panel["panel"]
54 + ctrl["bar control"]
55 + end
56 + root --> registry
57 + registry -->|entry points, sizing data, fixture| host
58 + root -->|typed injection| svc
59 + host -->|typed injection| panel
60 + panel -->|reads state| svc
61 + host -->|declared placement| ctrl
62 +```
64 +### Feature directory
66 +Names are free, responsibilities are invariant:
68 +```text
69 +features/<name>/
70 + Service.qml · Panel.qml · BarControl.qml · Model.js
71 + README.md (human overview, no binding rules)
72 + tests/ · fixtures/
73 +```
75 +- **service** — native integrations, system state, subprocesses, typed properties, intent methods; never geometry or focus.
76 +- **model** — pure transformations: classification, filtering, sorting, formatting, normalization; testable without QML or compositor.
77 +- **panel** — presentation, local cursor and focus state, intent emission, and every content state: normal, empty, unavailable, disabled, pending, failure, long content.
78 +- **bar control** — feature-owned bar presentation emitting intent; the registry states where it participates in bar layout.
80 +### Registry
82 +The single registration site: a typed QML registry, declarative entries, covered by `qmllint`. No runtime JSON manifests, no second schema.
84 +An entry covers:
86 +- stable feature ID;
87 +- service, panel, and bar-control entry points;
88 +- preferred and minimum dimensions, empty-state heights, sizing flags;
89 +- the named isolated fixture;
90 +- for specialized surfaces (lock, privilege), the owning controller kind instead of the default popup lifecycle.
92 +An entry never covers IPC handlers; they stay explicit and typed in `shell.qml`.
93 +Geometry: declarative sizing data lives in entries; generic computation stays in the host. `SurfaceManager` keeps computation and loses per-feature cases; `PopoutHost` stops switching on feature names.
95 +### Host
97 +Owns surface creation, screen selection, popup placement, lifecycle transitions, focus entry and return, outside dismissal, shared animation policy, and dependency injection. Contains no feature-specific rendering and no feature service logic.
99 +### Dependency and activation rules
101 +- Dependencies cross boundaries as explicit typed `required property` injection. No service registry, no singleton imports.
102 +- Features are selected at startup by checked-in composition. No runtime activation, no user-facing feature configuration.
104 +## Artifact rules
106 +1. One long-lived shell process per session.
107 +2. Services outside per-screen variants unless duplication is intended.
108 +3. `PanelWindow` for layer-shell surfaces, `FloatingWindow` for ordinary windows.
109 +4. Typed `required property` injection across component boundaries.
110 +5. One mutable state owner per concern; one geometry owner per axis.
111 +6. Shared controls and theme tokens.
112 +7. Pure logic outside QML where possible.
113 +8. JSON at IPC and diagnostics edges only.
114 +9. Loaders for expensive or rare surfaces; `keepLoaded`-style retention only when lifetime requires it.
115 +10. Event-driven service state over polling.
116 +11. Snapshot unstable native collections before feeding repeaters when required.
117 +12. Never `childrenRect` as a general sizing shortcut.
118 +13. Never weaken linting, isolation, or visual proof to make an iteration green.
120 +## Playbook
122 +Every task starts with a bounded contract:
124 +```text
125 +Feature · primary user action · observable result
126 +State owner · geometry owner · service boundary · caller · surface host
127 +States: normal | empty | unavailable | disabled | pending | failure | long content
128 +Input: pointer | keyboard | focus entry | focus return | Escape | outside click
129 +Proof: pure logic test | QML load test | interaction fixture | screenshots | full gate
130 +```
132 +Onboarding sequence: read RULES and the relevant spec; read the registry and one reference feature (audio); declare state and geometry ownership; implement and test pure model logic first; implement one complete interaction; register with one entry; run static and load checks; run the named fixture; inspect screenshots and logs; run the full gate.
134 +## Validation contract
136 +Evidence levels stay separate and are defined in RULES. Per feature:
138 +- the registry names an isolated fixture that loads its panel with fixture dependencies;
139 +- changed behavior requires interaction and visual evidence, not only static and load proof;
140 +- the full repository gate stays green: zero-warning lint, complete JS suite, `just ui-test`.
142 +## Decisions
144 +| # | branch | decision |
145 +| --- | --- |
146 +| 1 | primary outcome | new-feature onboarding |
147 +| 2 | edit budget | feature-local files plus exactly one explicit registration site |
148 +| 3 | surface scope | every surface kind, including future surface protocols |
149 +| 4 | protocol exceptions | lock/auth keep specialized controllers; popup host is default, not universal |
150 +| 5 | dependencies | explicit typed injection |
151 +| 6 | activation | startup composition only |
152 +| 7 | pilot | audio plus OSD |
153 +| 8 | state API | JSON-to-typed migration is a separate follow-up |
154 +| 9 | user configuration | none |
155 +| 10 | proof | a second agent onboards OSD independently against the frozen audio contract |
156 +| 11 | agent context | public contracts only |
157 +| 12 | layout | pilot physically moves audio and OSD into feature directories |
158 +| 13 | registry form | typed QML registry |
159 +| 14 | registry contents | service, panel, bar control, sizing data, fixture; never IPC |
160 +| 15 | abort criteria | owner judgement over recorded baseline metrics |
161 +| 16 | documentation | `.system/` is authority; READMEs are human overview |
162 +| 17 | geometry | data in registry entries, computation in the host |
164 +## Acceptance criteria
166 +- [ ] A second agent onboards OSD from public contracts alone, without host internals.
167 +- [ ] One registry entry plus feature-local files is the entire wiring for an ordinary feature.
168 +- [ ] The owner judges the pilot evidence sufficient to continue.
169 +- [ ] One state owner per concern, safe service boundaries, deterministic isolated tests, zero-warning checks, real interaction evidence, and reviewed rendered output hold throughout.
171 +## Non-goals
173 +Plugin marketplace; capability facades; new theme system; repository-wide rewrite; weakened sandbox; UI-owned native integrations; per-feature distribution; user configuration; runtime activation; runtime JSON manifests.

quickshell/nuguland/.system/specs/NL-SPEC-C24FF4FA-power-popup/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-C24FF4FA
3 +type: spec
4 +title: Power popup
5 +---
7 +# Power popup
9 +## Power state
11 +- A main battery hero appears only for a real laptop or display battery.
12 +- The hero shows circular percentage, lowercase state, time estimate, health when available, and the existing charge role.
13 +- Desktops never show a fake battery.
14 +- External battery devices appear as compact chips below the hero.
15 +- Without battery data, session actions become the first content.
16 +- Global low-power mode continues to reflect discharge state for animation throttling.
18 +## Session actions
20 +- `lock` is the primary safe action.
21 +- `suspend`, `monitor-off`, and `monitor-on` are secondary one-click actions.
22 +- `logout`, `reboot`, and `poweroff` occupy a separate danger region.
23 +- Destructive actions require two steps.
24 +- While confirmation is pending, the danger region becomes a focused card with the lowercase action name, `confirm`, and `cancel`.
25 +- Enter confirms and Escape cancels without on-screen keyboard instructions.
26 +- Existing real session effects remain unchanged.
27 +- No fake power-profile selector appears without a working profile service.
29 +## Safety and interface constraints
31 +- Session commands use fixed discrete argument vectors without shell interpolation or sudo.
32 +- Verification never executes logout, reboot, or poweroff; it covers their confirmation gate and route only.
33 +- Existing power, confirmation, low-power, and self-test IPC remains available.
34 +- State retains battery status, external devices, actions, compact state, pending confirmation, and last action.
35 +- State excludes backend narration and fake profile state.
37 +## Acceptance
39 +- Pure tests cover battery normalization, time and state labels, roles, battery detection, low-power detection, confirmation, and every route.
40 +- Runtime self-test passes without executing destructive actions.
41 +- A live visual check confirms battery-present and battery-absent layouts, external chips, safe and danger grouping, and in-place confirmation.
42 +- All UI labels are lowercase.

quickshell/nuguland/.system/specs/NL-SPEC-C49F734E-notification-surfaces-and-lifecycle/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-C49F734E
3 +type: spec
4 +title: Notification surfaces and lifecycle
5 +---
7 +# Notification surfaces and lifecycle
9 +## Outcome
11 +Notifications form one coherent system across a bar widget, persistent popup history, and transient toasts.
13 +## Behavior
15 +- The widget exposes unread or active state without rendering a card.
16 +- The popup renders full cards grouped by application.
17 +- Toasts render compact cards on the primary screen when notifications arrive.
18 +- Reusing a protocol ID updates its history row and visible toast without duplication or reordering.
19 +- Transient notifications may appear as toasts but never enter history.
20 +- Invoking an action closes a non-resident notification; resident notifications remain.
21 +- Dismissing a toast preserves history; closing a card removes that notification.
22 +- `clear all` removes history and visible toasts.
23 +- `dnd` immediately removes and suppresses low and normal toasts.
24 +- Critical toasts bypass `dnd` and remain until dismissed.
25 +- `SUPER+ESC` dismisses every visible toast, including critical toasts, without deleting history.
26 +- Positive expiry uses the supplied duration, unspecified expiry uses five seconds, and zero is sticky.
28 +## Rendering
30 +- Full cards show the resolved application icon, application name, relative time, summary, wrapped body, optional image, and server actions.
31 +- Compact cards show the resolved icon, summary, urgency, and applicable progress or lifetime state.
32 +- Named icons use theme lookup; image paths and URLs render as images.
33 +- Critical urgency is destructive, normal urgency is accented, and low urgency is subdued.
34 +- Full cards expose close, explicit copy, optional progress, and inline reply only when advertised.
35 +- User-facing labels are lowercase.
36 +- Drag-to-dismiss, debug metadata, cryptic count pills, and unused telemetry are absent.
38 +## Contracts and safety
40 +- Notification state remains additive and exposes active toast rows separately from history.
41 +- Copying body text requires explicit user action.
42 +- Native notification references are released when neither history nor a toast needs them.
43 +- Destructive history clearing is button-only and has no implicit keyboard route.
45 +## Acceptance
47 +- Isolated checks cover replacement, read preservation, `dnd`, critical bypass, sticky timeout, transient exclusion, and toast dismissal.
48 +- Real notifications verify icons, wrapping, images, actions, replacement, expiry, critical persistence, and `dnd`.
49 +- Screenshots confirm full and compact layouts and lowercase labels.
50 +- Popup history scrolls, the shortcut dismisses toasts end to end, and runtime logs contain no QML errors.

quickshell/nuguland/.system/specs/NL-SPEC-F1CFB1D7-connectivity-popup/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-F1CFB1D7
3 +type: spec
4 +title: Connectivity popup
5 +---
7 +# Connectivity popup
9 +## Wi-Fi behavior
11 +- iwd is the single Wi-Fi read and write authority.
12 +- The active station device is discovered rather than assumed from an interface name.
13 +- Rows retain iwd order and show connection state and signal strength.
14 +- Refresh races retain known managed rows rather than flashing an empty list.
15 +- Users can scan, connect, disconnect, forget, and toggle Wi-Fi.
16 +- Scan remains visibly active while asynchronous results settle.
17 +- An already-running scan is not shown as a hard failure.
18 +- Open and known networks connect directly.
19 +- A new secured network reveals an inline password field, submits once, and clears immediately.
20 +- Buttons visibly react to hover and press.
22 +## Bluetooth and connectivity
24 +- The existing native Bluetooth list and actions remain unchanged and refresh after asynchronous actions.
25 +- Supplemental connectivity status must not create another Wi-Fi row model or write path.
27 +## Security
29 +- SSIDs and passphrases are passed as discrete process arguments, never interpolated into shell commands.
30 +- A passphrase exists only for the transient connect call.
31 +- Passphrases never enter state, action history, errors, diagnostics, or logs.
32 +- Brief passphrase visibility in process arguments for a new secured network is the accepted single-user tradeoff.
33 +- Live Wi-Fi mutation is performed only by the controlling user, never by build or test workers.
35 +## Interface constraints
37 +- Existing connectivity and self-test IPC remains available.
38 +- State retains Wi-Fi enabled state, compact signal, exact network identity, and the minimal shader state required by its consumer.
39 +- Missing or malformed replies produce safe empty state rather than exceptions.
41 +## Acceptance
43 +- Sanitized fixtures cover managed objects, ordered networks, decoded names, known state, refresh races, signal shaping, malformed replies, and diagnostics.
44 +- Runtime self-test passes.
45 +- Live controller verification confirms scan, toggle, known or open connection, password handling, and unchanged Bluetooth behavior.
46 +- Fixture-based build verification performs no live mutation.

quickshell/nuguland/.system/specs/NL-SPEC-F3E26F58-launcher-popup/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-F3E26F58
3 +type: spec
4 +title: Launcher popup
5 +---
7 +# Launcher popup
9 +## Behavior
11 +- The launcher presents one full-width result list without a duplicate preview or provider chips.
12 +- It searches applications, actions, calculator results, clipboard rows, and windows.
13 +- `=` selects calculator, `>` selects actions, and `clip ` selects clipboard.
14 +- An unprefixed query searches all providers.
15 +- Matching supports exact, prefix, word-boundary subsequence, loose subsequence, and substring results.
16 +- Stronger matches rank first.
17 +- Application rows show themed icons with a provider-glyph fallback; other providers use distinct glyphs.
18 +- Rows show title and concise lowercase verb and subtitle metadata.
19 +- Calculator results emphasize the computed value and copy it on activation.
20 +- Empty queries list applications in title order.
21 +- Up and down change selection; Enter activates the selected result.
23 +## Constraints
25 +- Calculator input accepts only the existing numeric operator grammar.
26 +- Rejected or non-finite expressions produce no result.
27 +- Usage records remain telemetry and do not affect ranking.
28 +- Missing window or clipboard data contributes no rows and does not fail the launcher.
29 +- Existing application, window, calculator, clipboard, and action routes retain their effects.
30 +- Existing launcher IPC remains available and stable.
31 +- Search responses expose functional state without view narration.
33 +## Acceptance
35 +- Pure checks prove prefix parsing, score ordering, subsequence matches, misses, calculator rejection, icons, provider filtering, and ranking.
36 +- Runtime self-test passes.
37 +- A live visual check confirms icons and fallbacks, all providers, calculator copying, and keyboard selection.
38 +- The launcher has no decorative bottom stripe.

quickshell/nuguland/.system/specs/NL-SPEC-FDA339B0-brightness-popup-and-ddc-setup/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-FDA339B0
3 +type: spec
4 +title: Brightness popup and DDC setup
5 +---
7 +# Brightness popup and DDC setup
9 +## Display behavior
11 +- Only detected displays are shown.
12 +- A built-in row exists only when a usable backlight device exists.
13 +- Connected external monitors appear before DDC capability is known.
14 +- With no controllable display, detected rows and one primary `setup ddc` action appear without fake values or sliders.
15 +- With controllable displays, the popup shows a global control, four quarter-step presets, and one control per display.
16 +- Equal display values produce one normal global fill.
17 +- Different values produce one contiguous stacked multislider without a `mixed` label.
18 +- Global drag and presets set every controllable display; per-display drag changes only that display.
19 +- Readiness is implied by controls; issue badges appear only on affected rows.
21 +## DDC setup behavior
23 +- Setup progresses through preflight, authorization, installation, detection, reading, verification, and ready stages.
24 +- Every expanded stage remains visibly waiting, running, done, or failed.
25 +- Authorization occurs only after explicit user action and only when package or current-session setup is incomplete.
26 +- Arch's `ddcutil` package owns persistent system integration.
27 +- Nuguland does not duplicate package-owned module or udev configuration.
28 +- Detection maps external connectors to I2C buses.
29 +- A display becomes controllable only after a successful brightness read.
30 +- Partial monitor failure leaves working monitors controllable.
31 +- Successful setup collapses to a reopenable `ddc ready` state.
32 +- Failures identify the stage and allow retry from that stage.
33 +- Duplicate submission is disabled while running.
34 +- Cancellation retains completed package-native changes and reports cancellation.
36 +## Safety and diagnostics
38 +- Privileged setup is initiated only by the user through Nuguland's authorization flow.
39 +- Captured output remains internal; exposed diagnostics are bounded and redacted.
40 +- Diagnostics exclude passwords, environment variables, and arbitrary command lines.
41 +- Detection, reads, and writes have explicit timeouts.
42 +- DDC writes run unprivileged against the detected bus.
43 +- Successful writes update the row and OSD.
44 +- Failed writes preserve the previous value and show an inline error.
45 +- Invalid levels are clamped to the supported range.
47 +## Interface constraints
49 +- Existing brightness, display, setup, and self-test IPC remains available.
50 +- State distinguishes display rows, global none, synced, or mixed state, setup stages, errors, and compact state without debug narration.
52 +## Acceptance
54 +- Pure tests cover levels, roles, display shaping, mixed and synced state, DDC parsing, stage transitions, partial failure, redaction, timeouts, cancellation, and argument shaping.
55 +- QML checks prove setup is observable, writes target detected buses, and privileged work is not detached or opaque.
56 +- Full tests and the zero-warning lint gate pass.
57 +- A visual check confirms no fake controls, the multislider, presets, display controls, stage feedback, and lowercase labels.

quickshell/nuguland/.system/specs/NL-SPEC-FEE98E07-event-driven-audio-state/index.md

Added
new file mode 100644
1 +---
2 +id: NL-SPEC-FEE98E07
3 +type: spec
4 +title: Event-driven audio state
5 +---
7 +# Event-driven audio state
9 +## Outcome
11 +The shell reports audio, playback, and privacy facts without continuously capturing audio samples.
12 +Idle audio devices remain free to suspend.
14 +## Requirements
16 +- Output and input activity reflect active audio-graph links and mute state.
17 +- Playback activity reflects the active media player's playback state.
18 +- Volume and mute remain live, controllable properties.
19 +- Microphone and camera privacy indication retains its behavior.
20 +- The shell owns no continuous amplitude capture stream and performs no periodic level smoothing.
21 +- No state contract exposes amplitude levels or describes nonexistent peak capture.
22 +- Link presence is an acceptable activity proxy even when device suspension follows later.
24 +## Acceptance
26 +- An idle shell creates no peak-monitor capture node and causes no audio-level polling wakeup.
27 +- Media energy is `1` while playing and `0` while paused or stopped.
28 +- Audio controls, default-device selection, and mute controls work.
29 +- Microphone and camera indicators follow live use.
30 +- Audio and media state serialize without missing-property or load errors.
31 +- With no playback, the sink can become idle or suspended and sustained shell CPU remains below the former baseline.
33 +## Out of scope
35 +- Amplitude meters, waveforms, and VU displays.
36 +- Resource polling unrelated to audio.

quickshell/nuguland/AGENTS.md

Deleted
deleted file mode 100644
1 -# Quickshell / Nuguland
3 -The justfile is the source of truth for working with Nuguland: `./justfile`.
4 -Agents must use it.
6 -Public API only:
8 -```sh
9 -just lint
10 -just test
11 -just ui-test
12 -just fmt
13 -just build
14 -```
16 -Do not manually test by restarting/killing the parent niri session. Keep screenshots, pointer, keyboard, `wdotool`, and `wtype` proofs inside nested niri.
17 -Do not execute `niri-session` for inspection or testing; inspect its source instead.
18 -It ignores `--help` and can terminate the active desktop session.
19 -Execute it only when the user explicitly requests session startup.
21 -UI work:
23 -- Load `.pi/skills/nuguland-ui/SKILL.md` before creating, changing, or reviewing Nuguland UI.
24 -- Reuse `Theme.qml` and shared `Popup*.qml` controls; read their callers before changing shared behavior.
25 -- Static checks, source-pattern tests, and an IPC ping are not visual or interaction proof.
26 -- UI completion requires reviewed rendered screenshots and exercised pointer/keyboard flows in nested niri.
27 - `just ui-test` exercises shared controls in niri inside headless Weston, with synthetic state and retained screenshots/logs.
28 - It requires no desktop connection and opens no window in the main session.
29 - It does not cover every popup or live service; add fixtures for the changed flow.
31 -Zero-warning policy:
33 -- `just lint` gates typecheck, lint, all JS tests, format-check, shader freshness, and the existing runtime diagnostic check.
34 - Its live IPC ping does not prove a fresh configuration load.
35 -- `just lint` must emit no warnings and must fail on any non-disabled `qmllint` warning (`MaxWarnings=0`).
36 -- Nuguland runtime never compiles shaders.
37 -- Every future shader source must live under `shaders/*.frag`; `just build` must compile its checked-in `*.frag.qsb` blob.
38 -- `just lint` must fail when any shader blob is missing, stale, or orphaned.
39 -- Shader users must degrade cleanly when a checked-in blob is unavailable at runtime.
40 -- Do not disable `qmllint`, `shellcheck`, `shfmt`, `qmlformat`, shader build, Quickshell `.qmltypes`, import paths, shader freshness checks, runtime shader fallback, or any lint/test step without explicit human approval.
41 -- Do not exclude files from lint/format/build/check without explicit human approval.
42 -- Do not hide failures behind `|| true`, output filters, allowlists, or warning downgrades.
43 - Approved nested-fixture exception: classify the exact Niri software EGL fallback at DEBUG and assert exactly one deliberate screenshot-write warning within its action interval, as specified in `test-fixtures/ui/README.md`.
44 - Retain complete logs; all other diagnostics and production checks remain strict.
45 -- If tooling fails on existing code, report the blocker and fix it; do not call the work clean.
47 -UI text rule:
49 -- All Nuguland UI labels are lowercase.
51 -Shader implementation rule:
53 -- Before implementing any shader, research prior art online first: Shadertoy, Qt/QML shader examples, compositor shader examples, demoscene snippets, or other relevant sources.
54 -- Adapt the chosen prior art to Nugu semantics, Nuguland performance budgets, and the shader lifecycle above.
55 -- Write shaders from scratch only as a last resort, after prior-art search fails or proves unsuitable.
56 -- Document source inspiration in the comments when a shader is added.

quickshell/nuguland/NUGULAND-ARCHITECTURE-AND-AGENT-REVAMP.md

Deleted
deleted file mode 100644
1 -# nuguland architecture and agent revamp
3 -## purpose
5 -This document records the architecture research for Nuguland and the proposed changes that should make Quickshell development more effective with coding agents.
7 -It compares Nuguland with the `quattro` branch of Omarchy, which also uses Quickshell. The goal is not to copy Omarchy, but to identify the conventions that make its code easier to inspect, modify, and validate.
9 -## research basis
11 -Inspected:
13 -- installed Quickshell 0.3.1;
14 -- Quickshell 0.3.1 documentation;
15 -- the Nuguland source tree and its project instructions;
16 -- Nuguland's nested niri UI-test contract;
17 -- Omarchy's `quattro` branch, especially `shell/README.md`, `shell/plugins/README.md`, `shell/plugins/bar/README.md`, the plugin registry, shared UI components, and shell tests.
19 -Primary references:
21 -- <https://quickshell.org/docs/v0.3.1/guide/introduction/>
22 -- <https://quickshell.org/docs/v0.3.1/guide/qml-language/>
23 -- <https://quickshell.org/docs/v0.3.1/guide/size-position/>
24 -- <https://quickshell.org/docs/v0.3.1/guide/install-setup/#language-server>
25 -- <https://quickshell.org/docs/v0.3.1/types/Quickshell.Io/IpcHandler/>
26 -- Omarchy `quattro`: <https://github.com/basecamp/omarchy/tree/quattro/shell>
28 -## verdict
30 -Both Nuguland and Omarchy Quattro use the same fundamental Quickshell architecture: one long-running QML process with a `ShellRoot`, services, windows, and reactive state.
32 -Quattro does not appear more successful because Quickshell itself is different. It is easier for agents because it offers better **agent affordances**:
34 -- feature-local directories;
35 -- repeated manifest and entry-point conventions;
36 -- explicit shared UI modules;
37 -- fewer central registration edits;
38 -- named feature tests;
39 -- a canonical configuration model.
41 -Nuguland has stronger isolation, stronger static checks, and more trustworthy interaction evidence. Its main weakness is change locality. A local feature change often requires understanding and editing several central files.
43 -The recommended response is therefore:
45 -> Preserve Nuguland's service boundaries and test rigor. Adopt Quattro's locality, conventions, and feature contracts without importing its complete plugin ecosystem.
47 -## Quickshell mental model
49 -Quickshell is a QML runtime with native desktop integrations. It is not an opinionated application architecture. The project author decides how services, UI, configuration, and lifecycle are organized.
51 -A typical shell has this shape:
53 -```text
54 -shell.qml
55 - ├── long-lived services and state owners
56 - ├── IPC handlers
57 - ├── per-screen window instances
58 - ├── shared UI components
59 - └── feature surfaces
60 -```
62 -### root object and object graph
64 -Quickshell loads `shell.qml` and creates one QML object graph. QML properties are reactive bindings. When a dependency changes, dependent expressions are reevaluated.
66 -A root object does not have to be a particular Quickshell type. `ShellRoot` is useful for shell-level settings and composition. `Scope` is useful for long-lived non-visual objects.
68 -### windows and surfaces
70 -- `PanelWindow` is for bars, layer-shell panels, and overlays.
71 -- `FloatingWindow` is for ordinary desktop windows.
72 -- `PopupWindow` is for popup surfaces attached to another Quickshell window.
73 -- `WlrLayershell` controls layer-shell behavior on supported Wayland compositors.
75 -A window's actual size and position belong to the window or its container. Its implicit size expresses desired size.
77 -### screens and lifetime
79 -`Variants` creates instances from a model. `Quickshell.screens` is commonly used to create one bar or overlay per output.
81 -Services should normally live outside screen variants. Otherwise every monitor can create duplicate processes, timers, native service instances, or state owners.
83 -`Loader` controls deferred creation and destruction. A loaded item does not exist before the loader has created it. Any state that must survive loader recreation belongs in a longer-lived owner.
85 -### I/O and IPC
87 -Quickshell provides native QML-facing boundaries such as:
89 -- `Process` and `StdioCollector` for subprocesses;
90 -- `FileView` for file state and watching;
91 -- PipeWire, MPRIS, UPower, notifications, Polkit, PAM, and other service modules;
92 -- `IpcHandler` for typed external calls and properties.
94 -IPC functions should declare argument and return types explicitly. IPC is a public boundary, not a substitute for ordinary internal object ownership.
96 -### geometry rules
98 -The key layout rule is:
100 -```text
101 -implicit size flows from children to parents
102 -actual size flows from parents to children
103 -```
105 -Avoid these common errors:
107 -- using `childrenRect` to determine a container's implicit size when children are anchored to that container;
108 -- combining a layout, anchors, and explicit coordinates for the same axis;
109 -- setting a managed child's size instead of letting its container own it;
110 -- assuming invisible or unloaded content contributes useful geometry.
112 -### editor and tooling
114 -Quickshell recommends Qt's QML language server. A `.qmlls.ini` file next to `shell.qml` lets Quickshell generate machine-specific language-server configuration. The generated file should remain ignored.
116 -`PanelWindow` has known static-tooling limitations. A language-server failure to resolve it is not proof that valid runtime QML is broken. Use the matching Qt version, `qmllint`, the actual Quickshell runtime, and isolated compositor tests.
118 -## current Nuguland architecture
120 -Nuguland has a single shell composition root with injected services. Important parts include:
122 -```text
123 -shell.qml
124 - ├── services: audio, brightness, network, niri, power, media, vault, ...
125 - ├── bar windows
126 - ├── OSD and notification surfaces
127 - ├── privilege and lock surfaces
128 - ├── SurfaceManager
129 - └── PopoutHost
130 -```
132 -Current strengths:
134 -- service and panel separation already exists for important features;
135 -- dependencies use typed `required property` injection;
136 -- pure JavaScript logic has Node tests;
137 -- Rust has dedicated tests and strict clippy checks;
138 -- QML linting uses Qt 6 and zero warnings;
139 -- the UI runner uses nested niri, headless Weston, synthetic services, a private bus, retained logs, and screenshots;
140 -- the project explicitly separates static, load, interaction, and visual evidence.
142 -Current friction:
144 -- the source tree is mostly flat;
145 -- `shell.qml` contains substantial composition and IPC wiring;
146 -- `Bar.qml` contains broad feature knowledge;
147 -- `SurfaceManager.qml` owns lifecycle, geometry, panel state, and feature-specific sizing;
148 -- `PopoutHost.qml` has many service dependencies;
149 -- popup selection uses central switch cases and inline component declarations;
150 -- `popoutCatalog.js` describes popup content but does not author all registration;
151 -- UI code frequently consumes dynamic `stateJson()` snapshots;
152 -- a feature change can require synchronized edits across host, bar, catalog, service wiring, and fixtures.
154 -The problem is not simply file length. Quattro's shell and bar are also large. The more important problem is **change fanout**: how many unrelated places must be understood and kept consistent for one feature.
156 -## Quattro architecture
158 -Omarchy Quattro keeps one long-running `ShellRoot`, but organizes the feature surface around plugins:
160 -```text
161 -shell/
162 - shell.qml
163 - services/
164 - PluginRegistry.qml
165 - BarWidgetRegistry.qml
166 - service APIs
167 - plugins/
168 - bar/
169 - panels/
170 - overlays/
171 - menus/
172 - services/
173 - Ui/
174 - Commons/
175 -```
177 -Each plugin has a manifest with:
179 -- schema version;
180 -- stable ID;
181 -- display metadata;
182 -- declared kinds;
183 -- entry points;
184 -- optional bar-widget settings and defaults.
186 -The host discovers plugins, loads services, summons panels, injects APIs, and reads one versioned `shell.json` configuration.
188 -The useful ideas are:
190 -- feature directories are the default unit of work;
191 -- entry points are conventional and discoverable;
192 -- configuration is canonical and versioned;
193 -- common panel lifecycle is shared;
194 -- common styling and controls are in explicit modules;
195 -- JavaScript model logic is kept separately testable;
196 -- manifest entry points can be loaded as a generic contract test.
198 -The ideas that should not be copied without a real requirement are:
200 -- a third-party plugin marketplace;
201 -- dynamic capability facades everywhere;
202 -- unsandboxed user code as a distribution model;
203 -- broad `var` service APIs;
204 -- mixing native service ownership and visual presentation merely because a plugin makes it convenient.
206 -Quattro's own source demonstrates that its plugin facades are not a complete QML sandbox. Visual plugins share the host scene, and plugin code has user-level process and file access.
208 -## why agents struggle with Nuguland
210 -### QML has hidden semantics
212 -Agents often approach QML as if it were imperative UI code or web layout code. This causes:
214 -- imperative assignments that replace bindings;
215 -- duplicate state owners;
216 -- geometry binding loops;
217 -- invalid assumptions about `id` scope;
218 -- focus bugs after loader recreation;
219 -- missing handling for asynchronous service updates;
220 -- incorrect assumptions about when a component exists.
222 -### central wiring increases context cost
224 -The agent must inspect the service, the panel, the surface manager, the popup host, the bar caller, the relevant specification, and the isolated fixture. This is correct for safety, but expensive for every iteration.
226 -### dynamic snapshots hide contracts
228 -`stateJson()` is useful for diagnostics and external boundaries, but it hides the actual shape of the internal API from QML tooling and from agents. A consumer can silently depend on a missing, renamed, or differently typed field.
230 -### strict proof reveals more failures
232 -Nuguland requires:
234 -- zero-warning lint;
235 -- isolated runtime loading;
236 -- actual pointer and keyboard interaction;
237 -- focus and dismissal behavior;
238 -- retained logs;
239 -- rendered screenshots;
240 -- visual review.
242 -This makes Nuguland more honest, but it can make it look less successful than a project where runtime paths are conditional or visual output is only captured.
244 -## target architecture
246 -The target is a feature-oriented structure with explicit host boundaries, not necessarily a plugin marketplace.
248 -A feature should trend toward:
250 -```text
251 -features/audio/
252 - Service.qml
253 - Panel.qml
254 - Model.js
255 - feature.json
256 - README.md
257 - tests/
258 -```
260 -Equivalent names are acceptable. The responsibilities are the invariant.
262 -### service
264 -The service owns:
266 -- native Quickshell integrations;
267 -- mutable system state;
268 -- subprocesses and file I/O;
269 -- command execution;
270 -- external updates;
271 -- stable typed properties and intent methods.
273 -The service does not own visual geometry or panel focus.
275 -### model
277 -The model owns pure transformations:
279 -- classification;
280 -- filtering;
281 -- sorting;
282 -- formatting;
283 -- normalization;
284 -- state-to-label decisions.
286 -The model should be directly testable without QML or a compositor.
288 -### panel
290 -The panel owns:
292 -- presentation;
293 -- local cursor and focus state;
294 -- user intent emission;
295 -- empty, unavailable, pending, error, and long-content states;
296 -- keyboard and pointer behavior.
298 -The panel does not import native services when a Nuguland service already owns them.
300 -### host
302 -The host owns:
304 -- surface creation;
305 -- screen selection;
306 -- popup placement;
307 -- lifecycle transitions;
308 -- focus entry and return;
309 -- outside dismissal;
310 -- shared animation policy;
311 -- dependency injection.
313 -The host should not contain feature-specific rendering or feature-specific service logic.
315 -### descriptor
317 -A small descriptor should eventually author or validate:
319 -- stable feature ID;
320 -- bar or popup entry point;
321 -- preferred and minimum dimensions;
322 -- supported surface kind;
323 -- fixture name;
324 -- optional user settings schema;
325 -- empty-state sizing policy.
327 -The descriptor should remove duplicated registration rather than become a second source of truth.
329 -## artifact rules
331 -The optimal Quickshell artifact is a self-contained vertical slice, not the smallest possible QML file.
333 -Use these rules:
335 -1. Keep one long-lived shell process per session.
336 -2. Keep services outside per-screen variants unless duplication is intentional.
337 -3. Use `PanelWindow` for layer-shell surfaces and `FloatingWindow` for ordinary windows.
338 -4. Use typed `required property` injection across component boundaries.
339 -5. Keep one mutable state owner for each concern.
340 -6. Keep one geometry owner per axis.
341 -7. Use shared controls and theme tokens.
342 -8. Keep pure logic outside QML where possible.
343 -9. Use JSON for IPC and diagnostics, not as the default internal API.
344 -10. Use loaders for expensive or infrequently used surfaces.
345 -11. Use `keepLoaded`-style retention only when state or protocol lifetime requires it.
346 -12. Avoid repeated polling when event-driven service state is available.
347 -13. Snapshot unstable native collections before feeding them into repeaters when the service requires it.
348 -14. Do not use `childrenRect` as a general sizing shortcut.
349 -15. Do not weaken linting, isolation, or visual proof to make an agent iteration green.
351 -## agent playbook
353 -Every Quickshell task should begin with a bounded contract:
355 -```text
356 -Feature:
357 -Primary user action:
358 -Observable result:
360 -State owner:
361 -Geometry owner:
362 -Service boundary:
363 -Caller:
364 -Surface host:
366 -States:
367 -- normal
368 -- empty
369 -- unavailable
370 -- disabled
371 -- pending
372 -- failure
373 -- long content
375 -Input:
376 -- pointer behavior
377 -- keyboard behavior
378 -- focus entry
379 -- focus return
380 -- Escape
381 -- outside click
383 -Proof:
384 -- pure logic test
385 -- QML load test
386 -- interaction fixture
387 -- screenshots
388 -- full project gate
389 -```
391 -The recommended agent sequence is:
393 -1. Inspect the installed `qs` version.
394 -2. Read the matching Quickshell documentation and installed type metadata.
395 -3. Read project instructions and the relevant specification.
396 -4. Trace caller, surface host, panel, service, and existing fixture.
397 -5. Declare state ownership and geometry ownership before editing.
398 -6. Implement or test pure model logic first.
399 -7. Implement one complete interaction.
400 -8. Run static and load checks.
401 -9. Run the named isolated interaction fixture.
402 -10. Inspect screenshots and logs.
403 -11. Run the full repository gate.
405 -The agent should not begin by proposing a repository-wide rewrite. It should begin with one complete feature slice and measure whether the new convention reduces change fanout.
407 -## validation contract
409 -Evidence levels must remain separate:
411 -### static
413 -Examples:
415 -- Qt 6 `qmllint`;
416 -- QML formatting;
417 -- JavaScript syntax and unit tests;
418 -- Rust formatting, clippy, and tests;
419 -- shell checks;
420 -- shader freshness and compilation checks.
422 -Static checks do not prove that a surface loads or renders correctly.
424 -### load
426 -Load the actual Quickshell entry point or an isolated feature fixture. Check complete stdout and stderr for:
428 -- import failures;
429 -- binding loops;
430 -- type errors;
431 -- creation failures;
432 -- runtime warnings.
434 -### interaction
436 -Exercise the real QML surface inside nested niri:
438 -- pointer activation;
439 -- keyboard activation;
440 -- Tab and reverse Tab where applicable;
441 -- arrow keys;
442 -- Escape;
443 -- outside dismissal;
444 -- focus return;
445 -- external service updates;
446 -- empty and unavailable states;
447 -- asynchronous success and failure.
449 -### visual
451 -Capture and review the real rendered surface at supported output sizes and scales. Check:
453 -- clipping;
454 -- alignment;
455 -- hierarchy;
456 -- typography;
457 -- focus visibility;
458 -- state feedback;
459 -- long-content behavior;
460 -- animation and dismissal geometry.
462 -A screenshot capture is evidence of rendering, not automatic visual approval.
464 -## recommended migration strategy
466 -### phase 1: audio pilot
468 -Use audio as the reference slice because it already has:
470 -- a service and panel split;
471 -- pure JavaScript logic;
472 -- typed service injection;
473 -- production task-fixture coverage;
474 -- pointer, keyboard, external-update, and disabled-state cases.
476 -The pilot should introduce only the minimum feature-local convention and descriptor needed to reduce host edits.
478 -Measure:
480 -- central files touched by a feature change;
481 -- context files required before editing;
482 -- number of synchronized registration points;
483 -- number of source-regex assertions;
484 -- iterations before clean isolated evidence;
485 -- iterations before full lint passes.
487 -### phase 2: descriptor-backed registration
489 -Make one descriptor authoritative for popup identity, dimensions, entry point, fixture, and user-facing metadata. Add a generic contract test that loads every descriptor entry point with fixture dependencies.
491 -Do not remove existing checks until the descriptor has equivalent coverage.
493 -### phase 3: host decomposition
495 -Reduce the responsibilities of `SurfaceManager` and `PopoutHost` without changing the one-process model.
497 -Candidate boundaries:
499 -- popup lifecycle and focus controller;
500 -- pure surface layout functions;
501 -- feature panel state retention;
502 -- descriptor-backed content registry;
503 -- service composition root.
505 -### phase 4: typed internal service APIs
507 -Replace internal `stateJson()` consumption with typed readonly properties or QML models where practical. Keep JSON at IPC and diagnostics boundaries.
509 -### phase 5: feature-oriented test commands
511 -Add named public targets equivalent to:
513 -```text
514 -just test audio
515 -just load-test audio
516 -just ui-test audio
517 -```
519 -The exact commands must remain consistent with the repository's justfile contract. The purpose is a short, discoverable feedback loop, not a second test system.
521 -## non-goals
523 -This revamp does not currently require:
525 -- a third-party plugin marketplace;
526 -- dynamic capability facades;
527 -- a new theme system;
528 -- a rewrite of all QML files;
529 -- weakening the nested compositor sandbox;
530 -- replacing service ownership with UI-owned native integrations;
531 -- making every feature independently distributable.
533 -## success criteria
535 -The revamp is successful when an agent can implement a bounded feature by inspecting one feature directory, its descriptor, its caller, its service boundary, and its named fixture, without learning the entire shell first.
537 -The architecture must still preserve:
539 -- one authoritative state owner;
540 -- safe service boundaries;
541 -- deterministic isolated runtime tests;
542 -- zero-warning project checks;
543 -- real interaction evidence;
544 -- reviewed rendered output;
545 -- explicit security and lifecycle behavior.

quickshell/nuguland/TODO.md

Modified
1 1 - extend noko: streaming text, model registry or smarter update, LLM enhance with good context, cleaner ui
2 2 - syncthing widget
3 -- architecture revamp
4 3 - fix arrgh (on desktop?)

quickshell/nuguland/test-fixtures/ui/README.md

Modified
1 -# Nested UI test contract
1 +# Nested UI test harness
3 -`just ui-test` runs Quickshell inside niri inside headless Weston, never `niri-session` or the parent compositor.
4 -Weston uses its headless backend and Pixman renderer, with a 1280 × 720 virtual output by default.
5 -An optional `WIDTHxHEIGHT` argument selects another nested output size.
6 -The runner requires installed `weston`, `niri`, `qs`, `wdotool`, `bwrap`, `dbus-run-session`, Node, a C compiler, `pkg-config`, libsystemd headers, and `busctl`.
7 -It owns all child processes, its private runtime directory, session bus, and synthetic state.
8 -Bubblewrap denies access to the host HOME, system bus, network, and runtime sockets.
9 -No parent Wayland/X11 connection is mounted or inherited; no desktop session is required.
10 -Input and screenshot commands require verified child socket paths.
11 -Source files use a disposable overlay so Quickshell can generate `.qmlls.ini` without rewriting the host's configuration.
12 -The generated config is captured as evidence, not copied back onto the host.
3 +`just ui-test` runs Quickshell inside niri inside headless Weston — never `niri-session`, never the parent compositor.
4 +The agent-facing law lives in the nuguland System (`.system/RULES.md`); this file is the human overview.
14 -## Named replay
6 +## What it provides
16 -The runner accepts a positional fixture: `all`, `controls`, `popouts`, `system`, `privilege`, `noko`, `tasks`, or `niri`.
17 -Omitting it selects `all`, with every existing assertion enabled in the original order.
18 -Each named selection starts with fresh checked-in synthetic state and runs that suite's existing checks, not a recorded input stream.
19 -`controls` runs only the shared-control fixture.
20 -`popouts`, `privilege`, and `noko` run the extracted-panel fixture with its isolated service doubles.
21 -`popouts` additionally runs the production system-resource boundaries below; `system` runs only those boundary checks.
22 -`niri` runs the native integration fixture below.
23 -`tasks` runs real Bar and popup task flows with isolated service doubles.
24 -`all` runs tasks and then native integration after the earlier suites, before the complete-log gate.
25 -Invalid names, malformed sizes, and extra arguments fail before Bubblewrap starts.
8 +- Weston headless backend with the Pixman renderer; 1280 × 720 virtual output by default, `WIDTHxHEIGHT` overrides it.
9 +- A disposable source overlay, private runtime directory, private session bus, and bwrap sandbox denying host HOME, system bus, network, and runtime sockets.
10 +- Synthetic service doubles, real pointer and keyboard through the child sockets, screenshots from the child compositor, and retained logs for every phase.
11 +- A 300-second overall deadline, 30-second command/readiness budgets, and child shutdown escalating from SIGTERM to SIGKILL after two seconds.
27 -The public recipe is `just ui-test [fixture] [WIDTHxHEIGHT]`, defaulting to `all` at 1280 × 720.
28 -`just ui-test tasks 1366x768` and `just ui-test tasks 2560x1440` cover configured output geometries at scale 1.
13 +Never launch `refactor.qml` or `niri-integration.qml` directly: the runner's isolated service substitutions are mandatory.
30 -`replay.json` records `version: 1`, the selected `fixture`, the public rerun `command`, and the current `phase`.
31 -Phases are `startup`, `controls`, `popouts`, `privilege`, `noko`, `system-boundaries`, `tasks`, `niri`, and `runtime-diagnostics`.
32 -The runner also prints each phase as it starts.
15 +## Requirements
34 -## System issues and agent dispatch
17 +`weston`, `niri`, `qs`, `wdotool`, `wtype`, `bwrap`, `dbus-run-session`, Node, a C compiler, `pkg-config`, libsystemd headers, and `busctl`.
18 +The `niri` suite additionally needs `wayland-scanner`, Wayland protocol headers, libweston-15 headers, xkbcommon, `wl-paste`, and ImageMagick `identify`.
36 -`just ui-test popouts` exercises the production system panel with fixture-owned issue state:
37 -pointer and Enter/Space agent activation, Tab/Shift+Tab traversal, pending duplicate rejection, missing-tool failure and retry, dispatch dismissal, historical crash selection, battery/update agent exclusion, preserved update opening, long literal metadata, unavailable history, and empty state.
38 -The UI uses the approved pirate `arrrgh` action with an explicit assessment/diagnosis tooltip.
20 +## Suites
40 -`just ui-test system` additionally isolates the production `Resources.qml` service from external I/O with namespace-local command doubles.
41 -It verifies real Process completion, crash/OOM publication, both systemd manager scopes, missing Pi, retry, exact detached WezTerm argv and prompt payload, journal permission/malformed-output retention, and empty-history recovery.
42 -Repair-directory checks cover literal XDG paths, private creation, blocked-path failure without dispatch, stable cwd across issues, preserved existing reports, and verified-only issue-log instructions.
43 -Prompt-template checks cover malformed/missing files, rejection of stale cached instructions, live template edits on the next launch, facts-only JSON, and dispatch refusal for available updates.
44 -Crash-group checks cover same-executable/UID recurrence, separate unrelated apps/OOM, stable group identity, count/latest-time updates while pending, duplicate suppression, and latest-event opening.
45 -The production probe verifies every retained occurrence in a 100-record prompt larger than Linux's per-argument limit, private `@file` transport, immutable earlier snapshots, write failure/retry, and shrinking-window recomputation.
46 -Its IPC snapshot exposes occurrence counts rather than full event arrays to stay within Quickshell's response capacity; complete event bytes are verified in the actual generated prompt file.
47 -All template mutations occur inside the disposable project overlay.
48 -Actual report generation remains a Pi prompt obligation; the capture double does not simulate successful repairs.
49 -The terminal executable is a capture double, not a real Pi/provider session.
50 -No crash is deliberately induced and no core file is read.
51 -`resource-dispatch.jsonl` contains synthetic launch requests; `resource-probe-checks.json` records completed boundary assertions.
52 -The full `all` suite includes both paths.
22 +`just ui-test [fixture] [WIDTHxHEIGHT]`; default `all`.
54 -## Failure evidence
24 +- `controls` — shared `PopupButton`, `PopupSlider`, `PopupTextField` with real input.
25 +- `popouts` — clock/system panels with isolated service doubles plus production system-resource boundaries.
26 +- `privilege` — prompt focus, typing, reveal, cancel, Escape, failure shake.
27 +- `noko` — capture, transcription, and idle states; geometry across bar orientations.
28 +- `system` — production `Resources.qml` boundaries only.
29 +- `tasks` — real Bar and popup flows with isolated doubles: clipboard, launcher, audio, media, tray, power, connectivity, brightness, noko, vault.
30 +- `niri` — native integration: real Niri subscription, Bar pills, overview, screenshots, hotplug, xdg-shell clients.
56 -Before stopping children, the runner checks every runtime log and captures any interaction or diagnostic failure.
57 -It retains `failure.json` with the original error and stack, selected fixture, current phase, last successfully acquired redacted snapshot, screenshot path, and separate `captureErrors`.
58 -If the child niri process and both child sockets are verified, it attempts `failure.png` without changing the failing UI.
59 -Password-mode input is already masked by the actual control.
60 -Visible authentication input must be empty or in password mode; revealed nonempty input and unavailable safety state refuse screenshot capture and record the capture error instead.
61 -No UI is hidden or reset to manufacture safe evidence.
62 -Screenshots contain only sandbox fixture data.
63 -All fixture snapshots exclude editable text; editing assertions use boolean predicates instead.
32 +Each selection starts from checked-in synthetic state and runs that suite's assertions, not a recorded input stream.
65 -Capture errors never replace the original failure or skip child cleanup.
66 -The complete-log gate runs again after teardown, so shutdown diagnostics still fail the command.
67 -Sandbox startup failures and interruption retain an outer failure record when no inner record exists.
68 -The outer process never overwrites an inner failure with the generic sandbox exit status.
34 +## Evidence
70 -## Acceptance
36 +Everything lands in a fresh `.tmp/ui-test-*` directory:
72 -- Exercise production `PopupButton`, `PopupSlider`, and `PopupTextField` with real virtual pointer/keyboard input.
73 -- Assert both rendered control properties and their fixture-owned state through read-only IPC snapshots.
74 -- Cover mouse activation, keyboard traversal/activation, disabled activation, slider input, field editing/accept/cancel, and external state updates.
75 -- Capture before/after screenshots of the real surface, not an HTML replica.
76 -- Fail on process exit, readiness timeout, input/assertion failure, or runtime warnings/errors.
77 - Check selected Quickshell fixtures during polling and all child logs before and after teardown.
78 - Only the owner-approved native-fixture diagnostic exceptions below apply; production and QML checks remain unchanged.
79 -- Keep complete logs, snapshots, screenshots, commands, and tool versions in a fresh `.tmp/ui-test-*` evidence directory.
80 -- Reap owned children and remove only the temporary runtime directory on success, failure, or interruption.
81 -- Verify isolation and failure propagation with runnable checks.
82 -- Run successfully with `WAYLAND_DISPLAY`, `DISPLAY`, and `NIRI_SOCKET` unset; do not fall back to a window on the user's desktop.
38 +- `failure.json` — original error, phase, latest safe snapshot, capture errors.
39 +- `replay.json` — selected fixture, exact public rerun command, current phase.
40 +- `failure.png` — child-compositor screenshot when capture was possible.
41 +- `diagnostics.jsonl`, `refactor.log` — snapshot IDs and popup transitions.
42 +- `commands.log`, fixture and compositor logs, `versions.txt`, `outputs.json`.
43 +- Suite-specific records: `assertions.jsonl`, `resource-dispatch.jsonl`, `resource-probe-checks.json`, `niri-*.json`, `niri-files.jsonl`, and the `*-*.png` screenshots.
84 -The fixture requires at least 572 × 332 logical pixels; containment assertions reject a smaller nested output.
85 -The original fixture verifies shared controls, not every production popup or live service integration.
86 -Screenshot capture is evidence, not automatic visual approval.
45 +Screenshots contain only sandbox fixture data. Revealed nonempty authentication input refuses capture and records the refusal; a missing screenshot is explicit, never a pass.
88 -## Extracted-panel regression fixture
47 +## Approved diagnostic exceptions
90 -For `all`, after every original shared-control assertion completes, the runner terminates and reaps only that Quickshell process.
91 -A named extracted-panel selection starts that fixture directly and does not run the shared-control suite.
92 -The same Weston, niri, virtual input process, output, runtime, and private bus remain alive.
93 -Child shutdown escalates from SIGTERM to SIGKILL after two seconds; the entire sandbox has a 300-second deadline.
94 -The expanded task suite at 2560 × 1440 requires the larger software-rendering budget; per-command and readiness deadlines remain 30 seconds.
95 -Readiness and individual commands allow 30 seconds because software rendering competes with host builds.
97 -The runner copies the eight checked-in `services/*.qml` doubles over their namesakes only inside the disposable `/project` overlay.
98 -It materializes `refactor.qml` at that overlay's root, adjusting its relative import so Quickshell's scanner stays within the configuration directory.
99 -It never rewrites repository services or launches `shell.qml`.
100 -**Do not launch `refactor.qml` directly: the runner's isolated service substitutions are mandatory.**
102 -The doubles contain only QtQuick `Item` state and functions.
103 -They cannot spawn processes, access files/network, or register authentication agents.
104 -A regression check rejects additional imports, child object types, and privileged/dynamic APIs before installation.
105 -This source convention check complements the sandbox; it is not a general QML security parser.
106 -The real pure `Time.qml` is instantiated unchanged.
107 -The real typed `PopoutHost`, `ClockPanel`, `SystemPanel`, `PrivilegeSurface`, `NokoFocusOverlay`, `SurfaceManager`, and catalog remain unchanged.
108 -Unneeded service dependencies are null.
110 -Acceptance at the same 1280 × 720 logical output, scale 1:
112 -- Clock/system: pointer open, switch both ways, close, reopen, Escape, and outside dismissal in horizontal and vertical bar layouts.
113 - Assert actual card geometry against independent expected dimensions and catalog identity.
114 - Read the real `Diagnostics.qml` endpoint with synthetic typed services; assert snapshot schema, geometry, redaction, and correlation with popup transition IDs.
115 - Keep projected snapshots in `diagnostics.jsonl` and original transition records in `refactor.log`.
116 -- Calendar: pointer/type setup drafts, Tab into the synthetic credential field, pointer save with fixture result, empty agenda, external event update, and refresh on reopen.
117 -- Resources: populated identity/metrics/issues/processes, one issue-action route, external empty state, and balanced polling gates on switch, close, and reopen.
118 -- Privilege: pointer focus and literal typing, Enter rejection then success, reveal/hide, pointer cancel, Escape cancellation, and stable failure-shake frame dimensions.
119 - Snapshots exclude all editable text, including revealed input.
120 - Revealed-state screenshots are taken only with an empty field.
121 -- Noko: `capturing`, `transcribing`, `finished`, and idle; active/stopped animation ticks; geometry updates when bar orientation and thickness change without remounting.
123 -Snapshots use visual QObject children and property predicates rather than adding production testing APIs.
124 -Evidence includes rectangles, visible labels, service action counts, and input-focus state, never input contents.
125 -`clock-*`, `system-*`, `privilege-*`, and `noko-*` screenshots cover the changed components and relevant states.
126 -The parent reviews those images; static checks of production sources remain the parent's responsibility.
128 -### Observed focus behavior
130 -`PrivilegeSurface` focuses the initial prompt without repeatedly stealing focus from its controls.
131 -The fixture proves forward and reverse Tab traversal through input, reveal, cancel, and authorize.
132 -Prompt focus is optional when no privilege service is attached.
134 -### Private session services
136 -`session-bus.c` owns `org.freedesktop.login1` and `org.freedesktop.locale1` on the sandbox's private bus before Niri starts.
137 -It exports only read-only properties: an open lid and `pc105`/`us` keyboard settings with empty variant/options.
138 -No power/session/locale mutation methods exist.
139 -The installed libsystemd API supplies D-Bus protocol handling, not a custom protocol implementation.
140 -The executable refuses a missing sandbox marker, non-test HOME, visible host HOME/system socket, mismatched session/system addresses, and non-private bus addresses.
141 -The runner verifies Niri reads all five properties and independently checks boolean/layout values using `busctl`.
142 -`session-bus.log` retains those reads; removing a service or readiness condition still fails the run.
143 -No host bus or GPU device is exposed.
145 -### Approved native diagnostic assertions
147 -Owner approved these two narrow exceptions on 2026-09-06:
149 -- At most one exact `niri::backend::winit` **DEBUG** record reporting the software EGL render-node fallback is classified as expected infrastructure behavior.
150 - Its entire multiline message must match, including the `EGL_EXT_device_drm` cause.
151 - Changed source, severity, cause, duplicate occurrence, or another renderer diagnostic fails.
152 -- The intentional nonexistent-directory screenshot must produce exactly one exact `niri::niri` **WARN** record for `ENOENT`.
153 - It must immediately follow the DEBUG save attempt for `/evidence/missing-directory/native-failure.png`, inside the log interval measured around that action.
154 - Missing, duplicate, differently sourced/severity-coded, differently caused, or out-of-interval warnings fail.
155 - Suites without this scenario have no write-warning exception.
157 -These apply only to the owned `niri.log`, never Quickshell, Weston, fixture services, or production lint.
158 -`assertCleanLog` and production warning policy are unchanged.
159 -Raw logs are never filtered or rewritten; `runtime-diagnostics.json` retains classification counts and the expected action interval.
160 -Every complete log is checked before and after teardown, including later unexpected warnings.
161 -`ui-test.test.mjs` exercises positive and negative classification, scope, duplicate/missing records, malformed intervals, and unchanged strict checking.
163 -Run full lint and software-rendered UI suites serially.
164 -A concurrent run retained in `.tmp/ui-test-shQww4` hit genuine Weston presentation-timing warnings under load; those remain failures, not added exceptions.
166 -## Production task fixture
168 -`tasks.qml` loads real Bar, SurfaceManager, PopoutHost, panels, and shared controls.
169 -Pure `task-services/*.qml` doubles replace service boundaries only inside the sandbox overlay.
170 -Original sources are restored before native integration.
171 -Snapshots expose geometry, action counts, selection IDs, and boolean draft predicates, not editable or sensitive contents.
172 -Opening waits for four Qt animation frames and stable geometry before pointer targeting.
173 -Scroll-restoration assertions inspect the actual viewport and selected-row visibility, not just retained service values.
175 -Pointer and keyboard flows cover:
177 -- Clipboard search, mode selection, hover without destructive switching, close/reopen, and external updates.
178 -- Launcher query and selection restoration, plus keyboard focus scrolling through long result lists.
179 -- Audio thumb-grab stability, drag during external updates, and disabled routes.
180 -- Media capability changes and tray primary/secondary/menu keyboard actions.
181 - Empty media/tray shrink on last-item removal, dismiss/reopen, and restore populated geometry on item arrival in both orientations.
182 -- Compact power battery/action layout, contextual tooltip, pointer/Space safe actions, destructive arming/cancellation, Tab/Shift+Tab confirmation traversal, synthetic confirmation, and focus return.
183 - Confirmation pointer input waits for actual region containment after layout, not merely the service's pending flag.
184 - Desktop and multi-row external-device states retain all actions without blank regions.
185 -- Connectivity masked entry preservation during row refresh, and notification draft preservation and failed-send retry state.
186 -- Brightness pointer/keyboard changes, subsequent external updates without writeback, and unavailable-device rejection.
187 -- Noko capture start/stop, native sandbox clipboard copy, and keyboard traversal through scrollable history.
188 -- Vault keyboard selection reveal, zero-result detail clearing, and scroll/selection restoration after Loader recreation.
189 -- Horizontal and vertical layouts, constrained to the requested output geometry.
191 -This proves production UI against synthetic services, not real vault authentication, physical brightness control, network pairing, media playback, or speech recognition.
192 -`tasks-*.png` requires rendered review.
193 -Native focus-safe clipboard paste is checked separately below.
195 -## Native Niri integration
197 -Run `just ui-test niri`.
198 -**Do not launch `niri-integration.qml` directly: its sandbox and overlay vault substitution are mandatory.**
199 -The named suite is also included in `all`; no prior assertions or log gates are removed.
201 -Additional installed dependencies: a C compiler, `pkg-config`, `wayland-scanner`, Wayland protocol headers, libweston-15 headers, xkbcommon, `wl-paste`, and ImageMagick `identify`.
202 -The runner compiles only checked-in fixture sources, inside the sandbox, with `-Wall -Wextra -Werror`.
203 -The Weston module uses GNU C17 because the installed libweston header's deprecated attribute placement produces a GCC 16 C23 diagnostic.
204 -No warning category is disabled.
205 -Generated protocol code, binaries, and FIFOs disappear with the sandbox.
207 -### Owners and boundaries
209 -- Real `Niri.qml` owns the native subscription, reconnection, windows/workspaces/overview, and output polling.
210 - For `all`, the runner restores the original Niri source in the disposable overlay after the earlier pure service double is finished.
211 -- Real `Bar.qml` renders workspace pills and routes pointer actions.
212 - The real `SurfaceManager` is locally overridden only at popup opening so the Bar's vault `prepareOpen` reaches a pure fixture sink, without loading a vault panel or native vault boundary.
213 - Real `Theme`, `Time`, `Format`, and sandbox-local `Usage` support the Bar; unused services are null.
214 -- The xdg-shell client owns two plain synthetic windows and accepts title/app-ID changes through owned FIFOs.
215 - Close requests must reach its xdg close callback and exit normally, not be replaced by killing the process.
216 -- The normal pointer and client-keyboard helpers remain unchanged.
217 - Native overview/screenshot grabs require keys delivered through nested Weston's focused Niri surface: Niri's virtual-keyboard route did not close overview.
218 - The small Weston module uses installed public libweston keyboard APIs, accepts only Escape/Enter/Ctrl/C evdev keys, and verifies the focused client's kernel PID equals the runner's owned Niri PID.
219 - It is loaded only for `niri` and `all` and has no parent display or device access.
220 -- Only the production outputs Process is temporarily pointed at an owned Outputs-only server for hotplug/rejection fixtures.
221 - Version queries used by `niri msg` error reporting are forwarded to the child compositor.
222 - The stream and all actions always connect directly to real nested Niri.
223 - Repositioning uses the real output command and is asserted separately from synthetic hotplug.
224 -- Real `Screenshots.qml` owns pending/history and consumes real `ScreenshotCaptured` signals.
225 - A fixture-only readout shows focused title/app, last vault context, saved rows, and unconfirmed count.
226 - A private native `NotificationServer` accepts screenshot notifications without loading production notification services.
227 - Native Niri remains the only screenshot backend; `wl-paste` only reads its isolated clipboard result.
229 -### Assertions and evidence
231 -At 1280 × 720, scale 1:
233 -- Open two real windows, update focused title and app ID, switch focus/workspaces through actual Bar pills, and verify each vault opening receives current app context.
234 -- Type a synthetic query in the production clipboard popup, close it through the paste action, refocus the recorded destination, and prove the typing route inserts only fixture text in the native destination window.
235 -- Open native overview and close it using keyboard input.
236 -- Verify the subscription's exact `/usr/bin/niri msg --json event-stream` command and direct QML parent through namespace-local `/proc`, terminate only that PID, observe readiness false with cleared windows, mutate a window, and verify a different subscription PID initializes fresh state while QML survives.
237 -- Reposition real `winit` to `(400,120)`, verify the outputs-only poll observes it, and restore `(0,0)`.
238 - Then inject an added output, reject a query without clearing the last inventory, and restore the native inventory through polling.
239 -- Save native screen (1280 × 720), window (480 × 280), and pointer-selected interactive (401 × 201 inclusive pixels) captures.
240 - Assert dispatch remains pending before a matching completion, decode actual PNG files, and inspect fixture history.
241 -- Cancel a native selection with Escape, copy a selection with Ctrl+C and decode the clipboard PNG, reject capture with a null service, and save repeated same-path requests under distinct local IDs.
242 - Cancellation has no completion; clipboard-only and failed writes have null completion.
243 - None fabricate a saved record or resolve ambiguous pending entries.
244 -- Exercise a genuinely unwritable native destination, verify no file and no new history, and compare every visible saved row to an existing file.
245 -- Submit screen/window requests in one synchronous burst and verify both native files and completions, without terminating the preceding dispatch process.
246 -- Complete the service's selection route using native keyboard confirmation; assert its completion flash waits for the saved event.
247 - Close both clients and clear history visibly.
249 -`assertions.jsonl` retains each observed state.
250 -`niri-subscription.json`, `niri-reposition.json`, `niri-files.jsonl`, complete runtime/command logs, and `native-*.png` retain independent process/output/file evidence.
251 -Review `niri-bar-two-workspaces.png`, `niri-selection-pending.png`, `niri-saved-history.png`, `niri-repeated-history.png`, `niri-unconfirmed-history.png`, and `niri-cleared-history.png` for rendered results.
253 -### Native baseline before UX repair
255 -2026-09-06, Niri 26.04 revision `8ed0da4`, Quickshell 0.3.1, Weston 15:
257 -- `just test` passes, including 23 runner checks and 16 screenshot service checks.
258 -- `just ui-test niri` passes all 32 native interaction assertions and both complete-log gates.
259 - Evidence: `.tmp/ui-test-WZnHvB` from the project root.
260 -- `just ui-test all` passes 97 assertions across all suites and both complete-log gates.
261 - Evidence: `.tmp/ui-test-vKtl9w`.
262 -- `just ui-test controls` also passes without the write-failure scenario; its diagnostics report zero expected write warnings.
263 - Evidence: `.tmp/ui-test-cLxtKT`.
264 -- Reviewed the actual native-suite images: the top Bar's two pills, focused synthetic client, separate bottom fixture readout, native selection rectangle, three saved rows, five saved rows with three unconfirmed requests, and final empty state are visible without clipping at this geometry.
265 - The bottom readout is fixture UI, not production ScreenshotsPanel or VaultPanel coverage.
266 -- Private service fixtures remove the login/locale warnings at their cause.
267 - The exact EGL DEBUG fallback and intentional screenshot-write WARN are asserted according to the approved policy above, not hidden from evidence.
268 -- Real multi-output connect/disconnect, physical cross-monitor Bar ordering, brightness targeting and production vault backend/panel behavior remain unproven here.
269 - Hotplug is a clearly separated query fixture; capture tests cover sequential same-path repeats and simultaneous different-path requests.
270 - Native completion attribution remains ambiguous when external requests reuse an identical path.
271 -- Final `just fmt` and `just lint` passed; the latter's complete log is `.tmp/niri-handoff-lint.log`.
272 - Its parent-session runtime IPC ping proves reachability only, not fresh loading.
273 - Fresh fixture loading is established separately by the nested runs above.
49 +Exactly one expected `niri::backend::winit` DEBUG software-EGL record and one expected `niri::niri` WARN for the deliberate missing-directory screenshot write, both bound to `niri.log` and the measured action interval.
50 +The full rule, including what fails it, lives in `.system/RULES.md`.
275 52 ## Tooling
277 54 Follow the [official Quickshell language-server setup](https://quickshell.org/docs/v0.3.1/guide/install-setup/#language-server): create `.qmlls.ini` and let Quickshell generate it.
278 55 Use Qt6 executables, particularly `/usr/lib/qt6/bin/qmllint` on this host.
279 56 Do not patch static metadata to pretend it models runtime-only backend registration.
280 -The existing project lint policy remains unchanged.