Skip to content

Migrate all agents to new contract (closes KI-7 — all 8 issues resolved)#6

Merged
evkir merged 4 commits into
mainfrom
refactor/agents-migration
May 24, 2026
Merged

Migrate all agents to new contract (closes KI-7 — all 8 issues resolved)#6
evkir merged 4 commits into
mainfrom
refactor/agents-migration

Conversation

@evkir
Copy link
Copy Markdown
Owner

@evkir evkir commented May 24, 2026

No description provided.

evkir added 4 commits May 24, 2026 16:10
- run(target, context) instead of run(input_data) — target is an
  explicit arg, not pulled from self.session
- self.kb.set(key, value, agent=...) instead of writing to the
  non-existent self.session.knowledge_base dict
- add_finding(severity=, title=, ...) called with keyword args directly
  instead of constructing a Finding object (matches day-3 API)
- AGENT_NAME / ROLE set explicitly

Refs: STANDOFF.md day 6/30
…on.kb type

IntelAgent:
- run(target, context) instead of run(input_data)
- self.kb instead of self.session.knowledge_base
- self._log(msg) instead of self.log('intel', msg) (wrong arg order)
- IntelAgentV2 subclass folded in: scoring is now a built-in _score()
  step gated by score_cves=True; IntelAgentV2 kept as a plain alias

ReportAgent:
- run(target, context) signature
- self.kb.set(...) instead of self.session.knowledge_base
- datetime.utcnow() -> datetime.now(timezone.utc)

ScanSession.kb: was a plain dict, now a KnowledgeBase instance. This was
a latent bug — BaseAgent wrapped session.kb in a KnowledgeBase but the
session itself kept a dict, so agent.kb and session.kb diverged.
session.kb is now a real KnowledgeBase from creation; kb_set/kb_get
still work via __setitem__/get.

test_intel_v2.py rewritten to use the real BaseAgent contract (real
IntelAgent + mocked search_cves) instead of hand-built MagicMock agents.

Refs: STANDOFF.md day 6/30
- run(target, context) signature, _log() instead of log()
- self.kb.set(key, value, agent=...) for KB writes
- KI-7: self.llm.chat(messages=, system=) replaced with the real
  LLMClient method self.llm.call(messages=, system=)
- AI analysis extracted into _ai_analysis(); gracefully skipped when
  self.llm is None (e.g. dry-run) instead of crashing on a None call
- reads ranked CVEs from both kb['intel']['ranked_cves'] and the
  dedicated kb['intel.ranked_cves'] key written by IntelAgent._score
- ExploitAgentOOB updated to use _log()

This is the last of the 8 known issues — KI-7 closed.

Refs: STANDOFF.md day 6/30, closes KI-7
@evkir evkir merged commit c5753ee into main May 24, 2026
4 checks passed
@evkir evkir deleted the refactor/agents-migration branch May 24, 2026 13:26
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