# Baseline metrics ## Historical evidence Names, paths, findings and gate counts below describe the recorded tree, not today's onboarding contract. Current contract: [onboarding](../../specs/NL-SPEC-A7K4QX2M-nuguland-agent-onboarding/index.md). Recorded 2026-11-13 at trunk `0de41883`, before phase 1. Reference feature: audio. Counts come from inspecting the tree, not from an observed agent change; iterations to green is measured on the first pilot change. ## Change fanout for one audio change | Metric | Baseline | | --- | --- | | Feature-local files | 4 at root: `Audio.qml`, `AudioPanel.qml`, `audio.js`, `audio.test.js` | | Central production files naming audio | 7: `shell.qml` (27 lines), `PopoutHost.qml` (14), `Bar.qml` (6), `SurfaceManager.qml` (retained state entry), `popoutCatalog.js` (3), `Diagnostics.qml` (2), `diagnostics.js` (1) | | Registration points for an ordinary popup feature | 6 production: service instance and injections in `shell.qml`; required property, chip label and active cases in `Bar.qml`; required property, switch case, inline `Component`, retained-state casts in `PopoutHost.qml`; retained state in `SurfaceManager.qml`; catalog entry in `popoutCatalog.js`; projection in `Diagnostics.qml` | | Sites that stay by design | IPC handlers in `shell.qml` (10 `IpcHandler` blocks), startup composition | | Test wiring naming audio | 6: `test-fixtures/ui/tasks.qml`, `tasks.mjs`, `refactor.qml`, `niri-integration.qml`, `services/Audio.qml`, `task-services/Audio.qml`; plus `ui-test.mjs` overlay list | | Context files before an audio panel change | 18: 4 feature files; 5 central files (`shell.qml`, `Bar.qml`, `PopoutHost.qml`, `SurfaceManager.qml`, `popoutCatalog.js`); 4 fixture files (`tasks.qml`, `tasks.mjs`, both `Audio.qml` doubles); RULES; SYSTEM; specs `NL-SPEC-5F4166AF` and `NL-SPEC-38AED50A`; the `nuguland-ui` skill | | Iterations to green | unmeasured; count `just lint` and `just ui-test` runs from first edit to green on the pilot | ## After the audio pilot Re-measured 2026-11-13 on the tree committed with this section (step 3), by inspection. Filter for "files naming audio": production files outside `features/` whose audio mentions wire the audio feature (instance, injection, type, case, entry, projection); files that only mention the word in unrelated logic, icons, or layout order (`Media.qml` transport, `Osd.qml` icons, `Usage.qml` order, five `.js` helpers) are excluded, as they were for the baseline. | Metric | Baseline | After pilot | | --- | --- | --- | | Feature-local files | 4 at root | 6 in `features/audio/`: `Audio.qml`, `AudioPanel.qml`, `audio.js`, `audio.test.js`, `fixtures/load.qml`, `fixtures/services/Audio.qml` | | Host files naming audio (`PopoutHost`, `SurfaceManager`, `Bar`, `popoutCatalog`) | 4 | 0 | | Central production files naming audio | 7 | 4: `Registry.qml` (the entry), `shell.qml` (16 lines: IPC plus injections into `Media` and `Diagnostics`), `Diagnostics.qml`, `diagnostics.js` | | Production edits for a second feature like audio | 6 files | 2 files: one registry entry, plus `shell.qml` for IPC and any cross-feature injection; a diagnostics projection adds `Diagnostics.qml` and `diagnostics.js` | | Test edits for a second feature like audio | not counted | 4 shared files: suite name in `ui-test.mjs` (`taskSuites`, usage string), suite branch in `tasks.mjs`, projection and events in `tasks.qml`, and `refactor.qml` only if diagnostics read the service | | Test wiring naming audio | 6 plus `ui-test.mjs` | 4: `tasks.qml`, `tasks.mjs`, `refactor.qml`, `ui-test.mjs`; the double lives with the feature | | Context files before an audio panel change | 18 | 15: 6 feature files, `Registry.qml`, `FeatureEntry.qml`, `tasks.qml`, `tasks.mjs`, RULES, SYSTEM, two specs, the skill | | Iterations to green | unmeasured | not comparable: the pilot built the registry itself; measure on the OSD onboarding | The phase exit "one registry entry plus feature-local files is the entire wiring" is not met: IPC, cross-feature injection, and shared test wiring still sit outside the entry. | Structure | Baseline | After pilot | | --- | --- | --- | | Root source files | 126 | 125, plus `Registry.qml` (51 lines) and `FeatureEntry.qml` (34) among them | | `shell.qml` | 1382 lines | 1384 | | `Bar.qml` | 853 lines | 855 | | `PopoutHost.qml` | 487 lines, 13 cases, 14 components | 481, 12 cases, 13 components | | `SurfaceManager.qml` | 436 lines | 463: registry lookup, state seeding, catalog merge | Three of four host files grew while losing a feature: generic registry handling costs more lines than one removed case until more features migrate. ## Structure | Metric | Baseline | | --- | --- | | Root source files | 126: 66 QML, 36 JS, 24 MJS | | `shell.qml` | 1382 lines | | `Bar.qml` | 853 lines | | `PopoutHost.qml` | 487 lines, 13 feature cases, 14 inline `Component`s | | `SurfaceManager.qml` | 436 lines, per-feature retained state | ## Gate timing | Command | Baseline | | --- | --- | | `just test` | about 50 s | | `just lint` (includes `just test`) | about 90 s | | `just ui-test` | 134 s sequential before `0de41883`; 35 s with concurrent suites | ## Later upstream checks: Quickshell 0.3.2 Contextual evidence, not a global rule or promised line saving. Bounded native probes outweighed hypothetical savings: - ScriptModel: moved replacement records kept stale payloads; updated-prefix records reused delegates under wrong keys. StableListModel preserved both data and identity; retain it until upstream fixes are replayed in actual Qt. - JsonAdapter: malformed Usage JSON emitted its own warning despite `FileView.printErrors: false`; absent keys also retain values. Prevalidation/reset scaffolding would not simplify the current fallback. - Native windowsets/toplevels support activation but lack current workspace occupancy/global-focus policy and numeric niri paste-target identity. The validated event stream remains necessary. - Polkit AuthFlow drops prompt facts on submit and detaches on completion; `failed` means any prior failure, not the current attempt. Registration/no-flow proof does not establish conversation/security equivalence. - NotificationServer owns tracked objects independently of JS map references. Probes reproduced retained suppressed/cleared objects and a nonresident action double-close error; replacing lookup alone would change behavior, not fix lifecycle. Subsequent native production tests cover the repaired release and close-once paths, including replacement residency and protocol close reasons. - Screens/lock-shader alternatives lack multi-output/hardware or safe lock visual proof. No production substitution justified by these partial results. These checks reject direct substitutions at the observed version, not future upstream fixes. Keep native release, secret lifetimes, zero-warning and safe-focus requirements intact.