← Back to Pull requests

docs(openspec): record executable-to-package ownership decision for exposure intelligence #5921

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 22, 2026 03:29 UTC
Author

Intent

Documentation-only OpenSpec change for issue #5752 (prerequisite gate 0.3 of add-srql-exposure-intelligence). The approved requirement "Running Executables Resolve To Owning Packages" left two decisions open: the privilege model (netprobe drops to an unprivileged user and cannot read /proc/<pid>/exe of other users' processes) and the wire schema of the package reference. This change records the product owner's and coordinator's decisions as Decision 18 in design.md: netprobe keeps only CAP_SYS_PTRACE (permitted+effective, nothing ambient) after the drop; it resolves an executable to its owning package by comparing (dev, inode) of package-listed paths resolved inside the process root (dpkg, apk, rpm sqlite; rpm BerkeleyDB/NDB reported UNSUPPORTED_DB), cached per inode; it emits a shared ExecutableOwnership proto message with a resolution state, the EndpointPackageAssessmentIdentity fields, installed version and provenance, attached to FlowAttributionEvent/ProcessSnapshotEntry until #5738 moves it onto leases and summaries; core derives the pkgid key by matching to the device's current inventory package. The endpoint-software-inventory spec delta is tightened to match, with new scenarios for replaced binaries and unsupported rpm databases. Proof: openspec validate add-srql-exposure-intelligence --strict reports the change valid. No code changes. Test step note: no local builds or databases; quick checks only.

Review history: an earlier gate run of this branch went through four review rounds whose fixes are the four no-mistakes(review) commits on this branch (owner decisions on placement, disjoint and total states, identity fill rules mirroring the live ScaLibr producer with ecosystem empty, per-(root, dev, inode) cache entries, blank-as-absent key hashing, directory-symlink-only following); that run then failed only because the reviewer process hit "No space left on device". Already-decided points: the closed detail vocabulary stays (the coordinator required unsupported databases to be reported with a reason).

What Changed


  • Adds Decision 18 to add-srql-exposure-intelligence/design.md. It records the outcome of #5752's two open questions. On privilege: after the drop, netprobe keeps only CAP_SYS_PTRACE, in the permitted and effective sets, on one dedicated resolution thread. On wire schema: a shared ExecutableOwnership message carries a resolution state and the package identity, version and provenance. The decision also fixes how resolution works. Netprobe matches (dev, inode) against package-listed paths read inside the process root: dpkg, apk and rpm sqlite are supported, and rpm BerkeleyDB/NDB is reported as UNSUPPORTED_DB. Results are cached per (root, dev, inode). The five states are ordered and total. Core derives the package key from the device's current inventory.

  • Tightens the Running Executables Resolve To Owning Packages requirement in the endpoint-software-inventory spec delta to match. Until #5738 moves the reference onto lease owner records and connection summary rows, it is attached to FlowAttributionEvent and ProcessSnapshotEntry. New scenarios cover the lease/summary carry-over, NOT_FOUND for unowned executables, UNKNOWN for a replaced binary, and UNSUPPORTED_DB for a BerkeleyDB rpm host.

  • Updates gates 0.3 and 0.4 in tasks.md so they name the message types that carry ExecutableOwnership now and after #5738.
  • 🤖 Generated with Claude Code

    Risk Assessment

    ✅ Low: The deleted-executable cache bypass is stated the same way in the cost paragraph, the requirement, and the per-inode scenario, and it agrees with the UNKNOWN state that names no package.

    Testing

    The baseline test -f .bazelrc.remote had already passed. The diff touches only three OpenSpec Markdown files. openspec validate add-srql-exposure-intelligence --strict reported "Change 'add-srql-exposure-intelligence' is valid". A grep for non-ASCII bytes in the changed design and spec files found none. The spec delta includes the new replaced-binary and unsupported-package-database scenarios, and design.md contains Decision 18. No live scenario can be driven because nothing in the product changes at runtime, and per the intent no builds or databases were run.

  • Live validation: ⚠️ no-surface - 0 of 2 scenarios driven live against the product
  • | Scenario | Result | Live | Evidence |
    | --- | --- | --- | --- |
    | OpenSpec change validates in strict mode | ⏸️ untested | no | Docs-only change, so there is no runtime product surface to drive. The strict validation passed, but it checks the spec documents and does not exercise the product. |
    | netprobe resolves running executables to owning packages per Decision 18 | ⏸️ untested | no | This change only records the design and spec. The netprobe and core implementation are on other branches and PRs (#5914/#5919), so this change has nothing to drive live. |

    <details>
    <summary>Evidence: openspec strict validation</summary>

    Change 'add-srql-exposure-intelligence' is valid

    Change 'add-srql-exposure-intelligence' is valid
    

    </details>

  • Outcome: ⚠️ 1 warning across 1 run (2m46s)
  • Pipeline

    Updates from git push no-mistakes

    <!-- no-mistakes-pipeline-attestation:v1 {"head_sha":"23da0e8fe560b38744087c5d65c7466d6df84f55","steps":[{"step":"intent","status":"completed"},{"step":"rebase","status":"completed"},{"step":"review","status":"completed"},{"step":"test","status":"completed"},{"step":"document","status":"completed"},{"step":"lint","status":"completed"},{"step":"gate.lint.test-registration","status":"completed"},{"step":"gate.lint.elixir-quality","status":"completed"},{"step":"push","status":"completed"},{"step":"pr","status":"running"},{"step":"ci","status":"pending"}],"live_validation":{"verdict":"no-surface","live":0,"total":2}} -->

    <details>
    <summary>✅ Intent - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>✅ Rebase - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>🔧 Review - 1 issue found → auto-fixed ✅</summary>

  • ⚠️ openspec/changes/add-srql-exposure-intelligence/design.md:777 - Round 3&#39;s cache-validity fix left this sibling of the deleted-executable rule. A cache entry stays valid while mtime, size, and package-database state are unchanged (design.md:777-779, spec.md:46, and the per-inode scenario GIVEN at spec.md:59). The state order then says a kernel deleted mark is UNKNOWN and names no package (design.md:787-790, spec.md:46, replaced-binary scenario at spec.md:68-71). Unlink does not change those three inputs. Concrete sequence: sshd inode 100 is resolved and cached as RESOLVED to openssh-server; the binary is then unlinked (admin rm, or dpkg&#39;s rename before status and the info-directory fingerprint change) so /proc/&lt;pid&gt;/exe gains the kernel deleted suffix while mtime, size, and the package database are unchanged. The cache rule returns the cached RESOLVED reference and still names the package; the state order for that same input is UNKNOWN and names no package. The same skip turns a cached NOT_FOUND into a lie after a later unlink. Invalidate when the deleted mark changes (do not serve a linked-file entry for a later deleted read), and narrow the per-inode scenario so &#34;at most once&#34; applies only while that mark is unchanged too.
  • 🔧 Fix applied.
    ✅ Re-checked - no issues remain.
    </details>

    <details>
    <summary>⚠️ Test - 1 warning</summary>

  • ⚠️ this change has no live-validatable surface; proceed without live validation? (0 of 2 scenarios were driven live against the product); OpenSpec change validates in strict mode: Docs-only change, so there is no runtime product surface to drive. The strict validation passed, but it checks the spec documents and does not exercise the product.; netprobe resolves running executables to owning packages per Decision 18: This change only records the design and spec. The netprobe and core implementation are on other branches and PRs (#5914/#5919), so this change has nothing to drive live.

  • Live validation: ⚠️ no-surface - 0 of 2 scenarios driven live against the product
  • | Scenario | Result | Live | Evidence |
    | --- | --- | --- | --- |
    | OpenSpec change validates in strict mode | ⏸️ untested | no | Docs-only change, so there is no runtime product surface to drive. The strict validation passed, but it checks the spec documents and does not exercise the product. |
    | netprobe resolves running executables to owning packages per Decision 18 | ⏸️ untested | no | This change only records the design and spec. The netprobe and core implementation are on other branches and PRs (#5914/#5919), so this change has nothing to drive live. |

  • test -f .bazelrc.remote

  • <code>git diff --stat 1fa2b23..23da0e8 (confirms only the 3 openspec Markdown files changed)</code>

  • <code>openspec validate add-srql-exposure-intelligence --strict (valid)</code>

  • <code>LC_ALL=C grep -nP &#39;[^\x00-\x7F]&#39; on design.md and spec.md (no non-ASCII)</code>

  • <code>grep &#39;#### Scenario&#39; on the spec delta (replaced-binary and unsupported-DB scenarios present)</code>

  • </details>

    <details>
    <summary>✅ Document - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>✅ Lint - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>✅ gate.lint.test-registration - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>✅ gate.lint.elixir-quality - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>✅ Push - passed</summary>

    ✅ No issues found.
    </details>

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 2m
    All Vouch review confidence checks passed
    Residual risk 0.46 = Change Risk (0.52) × (1 − Review Confidence (0.13)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 13% · Reviewer familiarity: 35%
    12%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #5921"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 12.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 12.5% · Lower = rushed or shallow review
    12.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 45.5% · Moderate risk
    45.5%