Skip to content

Add interpretation dispatch and findings store - #11439

Merged
dezren39 merged 1 commit into
mainfrom
queue/16922-10040-interpretation
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/16922-10040-interpretation

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add append-only findings and interpretation-run tables plus a gatherer-only awaiting-interpretation view.
  • Add an operator CLI to list batches, record interpretation notes/findings/follow-ups, and import structured findings exports without guessing the absent Markdown grammar.
  • Add contract tests for strict arguments, dry-run behavior, and findings import.

Verification

  • (14 tests)
  • Live muse-dev2 verification: six interpretation runs, six findings, and no remaining gatherer batches awaiting interpretation.

The live database schema migration was already applied during task execution. The CLI's multiple PostgREST inserts are append-only but not transactional; it documents operator review before retry after partial failure.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 22:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T22:55:37.789461Z 17ee001 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.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 94cacd69-a41d-4eda-a4ce-c46d1b72c439
Commits

Reviewing files that changed from the base of the PR and between 6ee8002 and 17ee001.

Files selected for processing: 3

  • pkgs/fleet/migrations/0026_ainventory_interpretation.sql
  • scripts/ainventory-interpretation.py
  • scripts/tests/test_ainventory_interpretation.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@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: 17ee001e6b

ℹ️ 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 +519 to +521
existing = rest(key, "GET", "/findings?select=source_ref&limit=5000") or []
seen = {r.get("source_ref") for r in existing}
fresh = [r for r in rows if r["source_ref"] not in seen]

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 Paginate existing finding identities before importing

Once ainventory.findings contains more than 5,000 rows, this lookup cannot include every existing identity. Re-importing a file whose entries fall outside the returned window therefore inserts those findings again instead of skipping them. The new migration has no uniqueness constraint on source_ref, so these duplicate writes succeed, and the append-only enforcement prevents ordinary cleanup. Paginate the relevant identities or query the identities being imported directly before computing fresh.

Useful? React with 👍 / 👎.

Comment on lines +309 to +314
if status == "not_filed" and not entry.get("reason"):
raise SystemExit(
f"followups[{i}] is not_filed without a reason; an unfiled "
"follow-up is recorded with why"
)
out.append(entry)

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 Require a destination for filed follow-ups

When a follow-up contains only {"model":"x","status":"filed"}, this validation accepts it without any task_id or issue_url, despite the research-trail shape declared in the CLI help and migration. cmd_record then persists it as part of a completed interpretation run, removing the batch from the awaiting view even though the recorded follow-up has no traceable destination. Require a task or issue reference for filed entries before performing any writes, just as not_filed entries require a reason.

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