Skip to content

feat(windows): CU-17tkuw63weu report install metadata in the programs table - #132

Merged
denys-gif merged 1 commit into
masterfrom
feat/programs-install-metadata
Nov 5, 2026
Merged

denys-gif merged 1 commit into
masterfrom
feat/programs-install-metadata

Conversation

@denys-gif

Copy link
Copy Markdown

What

Adds four columns to the Windows programs table.

Column Values Source
system_component 1, 0 SystemComponent, set only for a non-zero DWORD
installer_type msi, exe, portable, msix WindowsInstaller, WinGetInstallerType, MSIX rows
install_scope machine, user HKEY_USERS is user, anything else is machine
install_arch 64, 32 WOW6432Node is 32. Machine scope only

ClickUp: https://app.clickup.com/t/17tkuw63weu. Follows #131.

Why

A backend matching installed programs to winget packages needs the same facts winget uses:

  • Winget skips SystemComponent entries, so they must not count as manageable.
  • Winget treats WindowsInstaller = 1 as MSI and anything else as EXE, and refuses an upgrade across those. Inno, NSIS and Burn sit in the same compatibility set as EXE, so they are not told apart.
  • Winget requires the installer scope to match the installed scope.
  • Winget does not use the architecture of a regular ARP entry. install_arch is here because it costs one line now and a release later.

Behaviour

  • The flags are collected in locals and set inside the existing if (!r.empty()). A subkey holding nothing but a flag still produces no row.
  • MSIX rows carry only installer_type.
  • install_arch is empty for user scope: the table reads only the native HKEY_USERS path, and the path says nothing about the architecture.
  • Existing columns and the row set do not change.

… table

Adds system_component, installer_type, install_scope and install_arch, so
a backend can apply winget's rules when it matches installed programs.
Winget skips SystemComponent entries, refuses an upgrade across installer
technologies and requires the installer scope to match.

The flags are collected in locals and set only on rows that already have
data, so a subkey holding nothing but a flag stays filtered out. MSIX rows
carry only installer_type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@denys-gif denys-gif self-assigned this Nov 5, 2026
@denys-gif
denys-gif enabled auto-merge (squash) November 5, 2026 17:06
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

🦩 Flamingo Code Review

➖ No tests ran on this commit (no lane ran): nothing here proves the change works.

2 findings: 🔴 0 action required · 🟠 1 recommended · 🔵 1 informational

Advisory: findings do not block the merge.

Checks: missing-test ×1 · 1 defect outside any rule

Files Lines 🔴 Action required 🟠 Recommended 🔵 Informational
3 +35 / -2 0 1 1

🟠 Recommended (1)

# Where Finding Flagged by
1 programs.cpp:40 The new classification columns are validated as any text, so the integration test checks none of their values Tests and mutation

🔵 Informational (1)

# Where Finding Flagged by
2 programs.cpp:223 2 new or changed definitions have no test referencing them (Minor) missing-test Tool-checked

✅ What this change does well

  • osquery/tables/system/windows/programs.cpp adds system_component/installer_type/install_scope/install_arch derivation consistently alongside existing field-extraction loop without altering unrelated logic.
  • specs/windows/programs.table documents each new column's semantics and edge cases (e.g. empty for MSIX packages) clearly.
  • tests/integration/tables/programs.cpp was updated in lockstep with the new schema columns using the existing ValidationMap/NormalType pattern.
  • osquery/tables/system/windows/programs.cpp correctly derives install_scope/install_arch from the already-expanded registry key path (HKEY_USERS and WOW6432Node), consistent with how programKeys are built in genPrograms.
  • tests/integration/tables/programs.cpp extends the ValidationMap to cover all four new columns, keeping the sanity test aligned with the schema in specs/windows/programs.table.
  • programs.cpp sets the new flags inside the existing if (!r.empty()), so a subkey holding only a flag still produces no row and the row set does not change.

Inline comments: 1 new

Outside the lines this diff changes (no inline comment possible)

  • 🔵 Informational · info · Minor · missing-test Tool-checked · osquery/tables/system/windows/programs.cpp:223: 2 new or changed definitions have no test referencing them
    No test file in this checkout mentions these definitions. Add or extend tests for the ones that carry logic.
    void keyEnumPrograms(const std::string& key,
    

🧪 Tests and mutation

Tests per lane

Language Project Command Status Counts Time

Stage 2 ran no lanes: the C++ lane is checks only, with no test or mutation command planned and no check available on this machine. The Windows-only code was not compiled or run.

🤖 Prompt for AI agents: fix every finding
Address these code-review findings on pull request #132 of flamingo-stack/osquery, most important first.
For each one, make the minimal change that resolves it and do not refactor unrelated code.
If you can show a finding is wrong, skip it and say why.

1. [Recommended] tests/integration/tables/programs.cpp:40 The new classification columns are validated as any text, so the integration test checks none of their values
   The four new columns use NormalType, which accepts any value, and no other test covers the new logic in keyEnumPrograms. A wrong or missing value in system_component, installer_type, install_scope or install_arch passes test_sanity.
2. [Informational] osquery/tables/system/windows/programs.cpp:223 2 new or changed definitions have no test referencing them
   No test file in this checkout mentions these definitions. Add or extend tests for the ones that carry logic.

Next: commit a suggestion, or hand a comment's prompt to your coding agent. React 👍 on a finding that helped and 👎 on one that is wrong: the reviewer learns from both.

Review again. New commits are not reviewed until you ask:

  • Review the new commits: only what was pushed since this review
  • Review the whole diff again: everything, including what was already reviewed

Or comment @flamingo-review (new commits) or @flamingo-review full (everything). Add the flamingo-review-always label to review every push.

Updated 2026-11-05 17:11 UTC · reviewed from Denys Slieptsov's machine

Comment thread tests/integration/tables/programs.cpp Resolved
@denys-gif
denys-gif merged commit 02a08ad into master Nov 5, 2026
17 of 18 checks passed
@denys-gif
denys-gif deleted the feat/programs-install-metadata branch November 5, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants