Skip to content

feat(security): M14.8 advisories in the agent's context (+ swarm_context route fix) - #214

Merged
ra3orblade merged 1 commit into
mainfrom
feat/m14-8-context
Oct 24, 2026
Merged

ra3orblade merged 1 commit into
mainfrom
feat/m14-8-context

Conversation

@ra3orblade

Copy link
Copy Markdown
Owner

Stacked on #213 (M14.5). The first of the three tasks added after the review: agents learn about advisories before a rule has to ask.

What it does

  • store.advisoryContextLine — the project's open advisories, worst first, one per package and version, at most six, each with the fixed version and the advisory id — joins sessionContext, so the SessionStart hook and swarm_context both carry it. Null while advisories are off or the project is clean. vulnerable_install is now among the rule modes the context names.

A bug the test found. /v1/context was registered twice and Hono answered from the first registration (the Observatory context-waste report), so the swarm_context MCP tool had always received a body without text and answered nothing to report. One handler now serves both: cwd selects the session context, its absence the report. The M7.10 route is reachable again.

Verification: typecheck · lint · test (1075 pass) · smoke · docs:check. The daemon test drives the fake OSV: the line appears in sessionContext and through /v1/context?cwd=, and is absent while the switch is off.

🤖 Generated with Claude Code

…m_context route fix

store.advisoryContextLine: the project's open advisory hits, worst first, one
per package and version, at most six, each with its fixed version and the
advisory id, as one "[swarm] known advisories in this project's lockfiles"
line in sessionContext — so both the SessionStart hook and swarm_context
(/v1/context) carry it. Null while advisories are off or the project is
clean. vulnerable_install joins the rule modes the context names.

Found by the new test: /v1/context was registered twice and Hono answered
from the first (the M9.6 context-waste report), so swarm_context had always
received a report without `text` and said "nothing to report". One handler
now serves both: `cwd` picks the session context, its absence the report.

Docs: roadmap M14.8 flipped (with the bug noted); the Observatory guide;
CLAUDE.md.

Verified: typecheck · lint · test (1075 pass) · smoke · docs:check.

Co-Authored-By: Claude <noreply@anthropic.com>
Base automatically changed from feat/m14-5-act to main October 24, 2026 10:38
@ra3orblade
ra3orblade merged commit a246deb into main Oct 24, 2026
2 checks passed
@ra3orblade
ra3orblade deleted the feat/m14-8-context branch October 24, 2026 10:38
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