Skip to content

fix(nvd): support full CVE rebuild without arg overflow#204

Merged
davida-ps merged 7 commits intomainfrom
codex/nvd-hermes-query-specs
Apr 22, 2026
Merged

fix(nvd): support full CVE rebuild without arg overflow#204
davida-ps merged 7 commits intomainfrom
codex/nvd-hermes-query-specs

Conversation

@davida-ps
Copy link
Copy Markdown
Collaborator

@davida-ps davida-ps commented Apr 21, 2026

User description

Summary

  • remove large JSON shell-arg passing in NVD pipeline/local script (--argjson "$(cat ...)") and switch to file-based --slurpfile usage
  • avoid transform drops by using a safe description fallback when an English description is missing
  • add a full-rebuild integrity guard: fail if transformed advisory count != filtered CVE count
  • add Hermes visibility in frontend feed UI (platform tab + platform badges in card/detail views)

Why this fixes the crash

Full scans can produce very large advisory arrays. Passing those arrays through command-line args can exceed OS argument size limits. This PR keeps payloads on disk and lets jq read them from files, which avoids ARG_MAX failures.

Validation

  • bash -n scripts/populate-local-feed.sh
  • workflow YAML parse (ruby -e ...)
  • local feed smoke run: ./scripts/populate-local-feed.sh --days 1 with temp feed paths

Notes

  • I also used a subagent to audit frontend platform rendering and applied the minimal Hermes visibility changes.

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Replace large JSON shell arguments in the NVD transformation workflow with file-based jq --slurpfile consumption, add a safe English description fallback, and fail full rebuilds if transformed counts differ from filtered CVEs. Add Hermes-aware platform badges and feed filtering so advisory cards and detail views expose platform visibility alongside the updated feed setup logic.

TopicDetails
Platform badges Expose Hermes-specific filters and badges across advisory cards, detail views, and feed setup so platforms are visible in the UI with normalized descriptors.
Modified files (6)
  • components/AdvisoryCard.tsx
  • components/AdvisoryPlatformBadge.tsx
  • pages/AdvisoryDetail.tsx
  • pages/FeedSetup.tsx
  • types.ts
  • utils/advisoryPlatforms.ts
Latest Contributors(2)
UserCommitDate
david.a@prompt.securitydocs: refresh README, ...February 26, 2026
David.a@prompt.securityClawSec initFebruary 05, 2026
Pipeline integrity Store advisory payloads on disk for the transform workflow, reuse safe English descriptions, and guard full rebuild counts so jq never receives giant args during the NVD rebuild flow.
Modified files (2)
  • .github/workflows/poll-nvd-cves.yml
  • scripts/populate-local-feed.sh
Latest Contributors(2)
UserCommitDate
david.a@prompt.securityfix(nvd): add hermes q...April 21, 2026
david@abutbul.comNanoclaw integration (...February 25, 2026
This pull request is reviewed by Baz. Review like a pro on (Baz).

@davida-ps davida-ps force-pushed the codex/nvd-hermes-query-specs branch from a04a83b to 2638481 Compare April 21, 2026 16:17
@davida-ps davida-ps marked this pull request as ready for review April 21, 2026 16:34
Comment thread pages/FeedSetup.tsx
Comment on lines 24 to +27
{ value: 'all', label: 'All Platforms', active: 'bg-clawd-accent text-white', inactive: 'bg-clawd-800 text-gray-400 border border-clawd-700 hover:border-clawd-accent/50' },
{ value: 'openclaw', label: 'OpenClaw', active: 'bg-clawd-accent/20 text-clawd-accent border-2 border-clawd-accent', inactive: 'bg-clawd-800 text-gray-400 border border-clawd-700 hover:border-clawd-accent/50' },
{ value: 'nanoclaw', label: 'NanoClaw', active: 'bg-clawd-secondary/20 text-clawd-secondary border-2 border-clawd-secondary', inactive: 'bg-clawd-800 text-gray-400 border border-clawd-700 hover:border-clawd-secondary/50' },
{ value: 'hermes', label: 'Hermes', active: 'bg-emerald-500/20 text-emerald-300 border-2 border-emerald-400', inactive: 'bg-clawd-800 text-gray-400 border border-clawd-700 hover:border-emerald-400/50' },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

community-advisory.yml still maps arbitrary Other: slugs into platforms even though platform tabs only cover openclaw, nanoclaw, and hermes, so approved nonstandard slugs won’t show in filtered views—should we constrain the contract to that set or add an other/catch-all path?

Finding type: Type Inconsistency | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In pages/FeedSetup.tsx
around lines 24-27 (the PLATFORM_TABS definition, and related
`selectedPlatform`/`filteredAdvisories` filtering), the UI platform tabs are hard-coded
to only `openclaw`, `nanoclaw`, and `hermes`, but the feed data can include arbitrary
platform slugs (from `Other:`). Refactor so the feed contract and the UI stay
consistent: either constrain/normalize incoming `a.platforms` to only the allowed
literal set before filtering, or add an “Other”/catch-all path (including a tab and
filtering behavior) that surfaces advisories with nonstandard platform slugs when
`selectedPlatform` is set accordingly. Update the relevant TypeScript types so
`selectedPlatform` and the tab values reflect the real set of selectable options, and
ensure nonstandard platforms don’t silently disappear when not on “All Platforms”.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commit 30f99eb addressed this comment by introducing a typed platform filter that includes an “Other” tab, normalizing incoming platform slugs, and filtering any advisory whose slug isn’t in the CORE_PLATFORM_SLUGS set under that catch-all option so nonstandard slugs remain discoverable.

Comment thread components/AdvisoryCard.tsx Outdated
Comment on lines +44 to +55
const getPlatformLabel = (platform: string) => {
switch (platform) {
case 'openclaw':
return 'OpenClaw';
case 'nanoclaw':
return 'NanoClaw';
case 'hermes':
return 'Hermes';
default:
return platform;
}
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

getPlatformLabel/getPlatformClasses in AdvisoryCard duplicate the platform mapping logic from AdvisoryDetail, so should we extract a shared helper/component like getPlatformDescriptor (or AdvisoryPlatformBadge) to keep both in sync?

Finding type: Code Dedup and Conventions | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commit 4e93032 addressed this comment by factoring the platform label and styling logic into the new AdvisoryPlatformBadge component (with shared getPlatformDescriptor) and swapping both AdvisoryCard and AdvisoryDetail to render that badge instead of duplicating the switch statements.

Comment thread components/AdvisoryPlatformBadge.tsx Outdated
Comment on lines +3 to +9
interface PlatformDescriptor {
label: string;
classes: string;
}

const normalizePlatformSlug = (platform: string) => platform.trim().toLowerCase();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

normalizePlatformSlug is duplicated in the badge code and pages/FeedSetup.tsx, should we move/export it as a shared utility and reuse it so normalization stays in sync with the filtering/labels?

Finding type: Code Dedup and Conventions | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commit 9677b69 addressed this comment by moving normalizePlatformSlug (along with getPlatformDescriptor) into utils/advisoryPlatforms and reusing those exports from both AdvisoryPlatformBadge and FeedSetup, keeping the normalization logic shared between the badge and filters.

Comment on lines +30 to +41
export const getPlatformDescriptor = (platform: string): PlatformDescriptor => {
const normalized = normalizePlatformSlug(platform);
const descriptor = PLATFORM_DESCRIPTOR_BY_SLUG[normalized];

if (descriptor) {
return descriptor;
}

return {
label: platform.trim() || platform,
classes: 'bg-clawd-700 text-gray-300 border border-clawd-600',
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

getPlatformDescriptor has extra if/fallback branching after PLATFORM_DESCRIPTOR_BY_SLUG[normalized], should we simplify to return PLATFORM_DESCRIPTOR_BY_SLUG[normalized] ?? { ... }?

Finding type: Conciseness | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
utils/advisoryPlatforms.ts around lines 30-41, refactor the `getPlatformDescriptor`
function to remove the extra `if (descriptor) { return descriptor; }` branching.
Instead, compute `normalized`, then directly return
`PLATFORM_DESCRIPTOR_BY_SLUG[normalized] ?? { label: platform.trim() || platform,
classes: 'bg-clawd-700 text-gray-300 border border-clawd-600' }` so the default is only
used when the lookup is `undefined`. Keep the normalization and fallback label logic
exactly the same, but simplify the control flow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commit 899997c addressed this comment by simplifying getPlatformDescriptor to return PLATFORM_DESCRIPTOR_BY_SLUG[normalized] with a ?? fallback, removing the redundant descriptor variable and if branch.

@davida-ps davida-ps merged commit 1efb813 into main Apr 22, 2026
13 checks passed
@davida-ps davida-ps deleted the codex/nvd-hermes-query-specs branch April 22, 2026 10:58
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