Skip to content

feat: integrate runtime provenance with audited production dependencies - #248

Open
Joncallim wants to merge 47 commits into
mainfrom
codex/68-provenance-audit-integration
Open

feat: integrate runtime provenance with audited production dependencies#248
Joncallim wants to merge 47 commits into
mainfrom
codex/68-provenance-audit-integration

Conversation

@Joncallim

Copy link
Copy Markdown
Owner

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.

  • Base: b3014db (approved Express production dependency remediation)
  • Provenance head restacked: c5e3063
  • git range-diff 6137ebb..b3991a5 b3014db..c5e3063: all 46 provenance commits are patch-equivalent.
  • No feature edits or conflict resolutions were required.

Validation

  • npm ci
  • npm audit --omit=dev --json — 0 production findings
  • npm run typecheck
  • npm run check:contracts — 23 contract tests
  • npm run test:api — 77 tests
  • npm run test:rust:core — 67 tests
  • npm run test:rust:daemon — 163 tests
  • npm run fmt:rust:check and npm run lint:rust
  • npm run test:deployment — 6 tests
  • npm run build:deploy
  • Rebuilt Docker image; CI-equivalent runtime dependency boundary and health/snapshot smoke passed.

npm ci reports three dev-only high-severity advisories; the production-only audit is clean and this PR does not suppress or reclassify those separate dev findings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T18:33:37.340529Z c5e3063 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +218 to +220
// 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +196 to +204
StaticProviderSlot::Systemd => {
collect_systemd_runtime_provider(pid_namespace, &mut collection);
collection.set_state(
slot,
if pid_namespace.is_restricted() {
ProviderStateKind::Disabled
} else {
ProviderStateKind::Fresh
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +131 to +133
if membership_counts.get(&pair) != Some(&1)
|| port_counts.get(edge.source.as_str()) != Some(&1)
|| !is_candidate_internal_network_membership(edge, &nodes)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +665 to +670
&& container.mounts.iter().any(|mount| {
mount.kind == crate::ComposeMountKind::Bind
&& mount
.source
.as_deref()
.is_some_and(is_docker_daemon_state_bind_source)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread Dockerfile
Comment on lines +51 to +53
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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