feat: integrate runtime provenance with audited production dependencies - #248
feat: integrate runtime provenance with audited production dependencies#248Joncallim wants to merge 47 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5e3063bd6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // An opaque observation token must never be the collection timestamp | ||
| // re-labelled as a revision. The daemon produces it independently. | ||
| return typeof value.providerRevision === "string" && value.providerRevision !== String(value.collectedAt); |
There was a problem hiding this comment.
Reject noncanonical runtime evidence summaries
When the daemon is malformed or compromised, hasCoherentRuntimeEvidence accepts any schema-valid summary instead of the fixed summary associated with each evidence kind. A raw unit, process, or package-auth secret that does not match publishApiPayload's limited marker heuristics can therefore pass /api/runtime/map validation and be rendered by the evidence inspector; bind each kind to the canonical summaries already emitted by the Rust producers.
AGENTS.md reference: AGENTS.md:L17-L20
Useful? React with 👍 / 👎.
| StaticProviderSlot::Systemd => { | ||
| collect_systemd_runtime_provider(pid_namespace, &mut collection); | ||
| collection.set_state( | ||
| slot, | ||
| if pid_namespace.is_restricted() { | ||
| ProviderStateKind::Disabled | ||
| } else { | ||
| ProviderStateKind::Fresh | ||
| }, |
There was a problem hiding this comment.
Treat failed systemd commands as failed collections
When either fixed systemctl invocation returns an error or nonzero status, the collector returns after adding a diagnostic, but this branch still marks the dedicated Systemd slot Fresh. On an initial failure this publishes fresh collection metadata for no usable observation, and after a successful pass a transient failure replaces retained dependency evidence with an empty fresh collection rather than preserving it as stale, causing findings to disappear until a later successful refresh.
Useful? React with 👍 / 👎.
| if membership_counts.get(&pair) != Some(&1) | ||
| || port_counts.get(edge.source.as_str()) != Some(&1) | ||
| || !is_candidate_internal_network_membership(edge, &nodes) |
There was a problem hiding this comment.
Allow findings for containers publishing multiple ports
When an internal-network container publishes two or more distinct host ports, port_counts exceeds one and this condition suppresses the advisory entirely, even though every port edge has valid fresh Docker evidence and the rule only requires that a host port exists. Multi-port containers are common, so ambiguity protection should reject duplicate/conflicting evidence without treating multiple legitimate listener targets as absence of the condition.
Useful? React with 👍 / 👎.
| const [layerFilter, setLayerFilter] = useState<RuntimeLayerId | "all">("all"); | ||
| const [attentionOnly, setAttentionOnly] = useState(false); | ||
| const [selectedId, setSelectedId] = useState<string | null>(null); | ||
| const [selectedEdge, setSelectedEdge] = useState<SelectedRuntimeEdge | null>(null); |
There was a problem hiding this comment.
Reconcile selected evidence after runtime refreshes
When a background refresh replaces model.runtime while the selected node survives, this state retains the complete edge object from the previous revision. If that relationship changes or disappears, the relation lists show current topology while the inspector continues displaying the old freshness, provider revision, and summary indefinitely; store an identity and re-resolve it against the current model, or clear the selection when the runtime revision changes.
Useful? React with 👍 / 👎.
| && container.mounts.iter().any(|mount| { | ||
| mount.kind == crate::ComposeMountKind::Bind | ||
| && mount | ||
| .source | ||
| .as_deref() | ||
| .is_some_and(is_docker_daemon_state_bind_source) |
There was a problem hiding this comment.
Match actual daemon-state paths rather than any socket component
When a bind source merely contains a path component named docker.sock, such as /srv/docker.sock/archive where that component is a directory, the shared predicate returns true and this filter emits evidence and a warning claiming possible Docker daemon authority. Restrict socket detection to an actual socket source path or the supported canonical socket paths while retaining the /var/lib/docker subtree case.
Useful? React with 👍 / 👎.
| RUN npm prune --omit=dev \ | ||
| && test ! -e node_modules/.bin/tsx && test ! -e node_modules/.bin/vite \ | ||
| && test ! -d node_modules/typescript && test ! -e node_modules/@playwright/test/package.json |
There was a problem hiding this comment.
Scope production pruning to the API workspace
In the checked Docker build, npm prune --help identifies -w|--workspace <workspace-name> as the workspace selector, but this root invocation supplies neither it nor a package. Consequently npm retains production dependencies for every workspace, including the web-only React and React Router packages, and the runtime stage copies them despite claiming an API-only closure; the CI checks only exclude selected development tools and do not detect these unused production modules.
Useful? React with 👍 / 👎.
Integration
This is the single integration branch for the final #68 runtime-provenance stack and the approved production dependency remediation from #237. It is based on the actual audit commit rather than only retargeting a PR.
b3014db(approved Express production dependency remediation)c5e3063git range-diff 6137ebb..b3991a5 b3014db..c5e3063: all 46 provenance commits are patch-equivalent.Validation
npm cinpm audit --omit=dev --json— 0 production findingsnpm run typechecknpm run check:contracts— 23 contract testsnpm run test:api— 77 testsnpm run test:rust:core— 67 testsnpm run test:rust:daemon— 163 testsnpm run fmt:rust:checkandnpm run lint:rustnpm run test:deployment— 6 testsnpm run build:deploynpm cireports three dev-only high-severity advisories; the production-only audit is clean and this PR does not suppress or reclassify those separate dev findings.