Skip to content

Add rich hardware identification and lossless compact AI context - #2

Merged
avds2 merged 4 commits into
mainfrom
feat/hardware-context
Oct 1, 2026
Merged

avds2 merged 4 commits into
mainfrom
feat/hardware-context

Conversation

@avds2

@avds2 avds2 commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

RAM identity previously lived mainly in optional DMI evidence, leaving the canonical model with only OS-visible capacity. This change adds standard-profile typed memory arrays/modules and broader CPU, GPU, firmware, disk and system-battery identity, with explicit discovery gaps instead of inferred DDR/vendor details.

Changes:

  • Accept legacy and IEC capacity spellings from dmidecode (GB/GiB, MB/MiB, etc.) so installed modules and firmware array limits remain available across tool versions.
  • RAM capacity/type/manufacturer/part number, slots, populated/empty state, rank, ECC policy and rated/configured speeds. Firmware-installed capacity stays distinct from OS-visible RAM. DMI serial/asset identifiers are filtered before persistence; failed/truncated probes cannot produce module facts.
  • CPU topology/cache/selected ISA features, microcode and vulnerability/mitigation reports; motherboard/BIOS identity; GPU PCI model/driver/available VRAM; disk model/transport/capacity/flags; system battery full/design capacity; available RAM and swap counters. Loop and kernel RAM disks and peripheral batteries are excluded.
  • Omit redundant hardware text during automatic snapshots while preserving focused evidence under named targets/all.
  • Add context.ai.json, a lossless dictionary/template view with an embedded decoding guide and an exact round-trip gate. It falls back to canonical encoding when dictionary overhead would increase bytes. It shares final residual scanning, manifest, archive and transactional publication. Existing context.json v5 integrations remain compatible.
  • Bound bluetoothctl list to five seconds; failed/truncated discovery leaves the count unknown and records probe telemetry. Stop collector descendants before private staging cleanup on INT/TERM or early exit, including producers in timeout process groups. Add Bluetooth timeout/failure/truncation and INT/TERM cleanup regressions.
  • Document hardware limitations, coverage and AI ingestion; add hardware/sysfs/privacy/failed-probe/truncation and AI-view publication regressions.

Validation:

  • IEC capacity regression and hardware collector tests plus syntax checks passed locally. Replaying an uploaded GiB-formatted DMI sample now produces two populated 8 GiB modules, 16 GiB installed and a 32 GiB array limit. Full GitHub Actions make check for c099dd9 passed on Python 3.9, 3.11 and 3.13 (run 36916993972).
  • Follow-up hang/interrupt fix: new local Bluetooth and cancellation regressions plus syntax checks passed. All runnable local tests passed; ownership/publication and Docker fixtures remain constrained by the local namespace. Full GitHub Actions make check for commit 8f7beb0 passed on Python 3.9, 3.11 and 3.13, including ownership/publication and Docker fixtures (run 36915753279).
  • Full GitHub Actions make check passed on Python 3.9, 3.11 and 3.13, including ownership and Docker fixtures (run 36839081843).
  • Local syntax, hardware and AI-view tests passed. All non-Debian scripts and non-Docker Debian fixtures passed locally. The local execution namespace maps only UID/GID 0 and forbids Unix sockets, so full ownership/Docker coverage was verified on CI instead. No source tests were relaxed.
  • max snapshots validated without structural errors; pre-existing evidence warnings were unchanged. Automatic evidence fell from 48,027 to 43,201 bytes on the restricted environment. The sparse snapshot correctly used canonical fallback for the AI view. A 32-module test model fell from 11,482 to 4,147 bytes with exact reconstruction; these are byte sizes, not tokenizer measurements.

Limits: module details remain dependent on dmidecode, privileges and firmware quality. Firmware slot/max-capacity claims are not guaranteed upgrade advice, disk identity may describe virtual media, and battery full/design ratio is an estimate, not a health test.

@avds2
avds2 marked this pull request as ready for review October 1, 2026 19:57
@avds2
avds2 merged commit 2615be7 into main Oct 1, 2026
3 checks passed
@avds2
avds2 deleted the feat/hardware-context branch October 1, 2026 19:57
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.

1 participant