Files
rengine/shared/models/changes.py
T
Yogesh OjhaandClaude Fable 5.1 e8ac1b7fbc feat(changes): what is new to hunt, with a contribution grid
The feed reports new surface only: web assets a later scan was first to
find, scope a program opened, programs added or made public, hosts a
certificate revealed under a watch, and targets Bounty Hub brought in by
watch or scope. A first scan yields nothing, hand-added targets are the
activity log's business, and scope removals stay in Bounty Hub. Program
events count for programs the project watches or whose scope covers one
of its targets. The response carries per-day buckets per kind, drawn as
a week-column grid above the list; a lit day scrolls the list to its
header. Days are keyed in UTC on both sides. Windows are 7, 30 and 90
days, default 30.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XfLmNNiLk5VdePfq9CpugW
2026-09-18 06:01:39 +05:30

48 lines
1.1 KiB
Python

from __future__ import annotations
import uuid
from datetime import datetime
from pydantic import BaseModel, Field
from shared.definitions.changes import ChangeTone
class ChangeItem(BaseModel):
id: str
at: datetime
kind: str
label: str
value: str
detail: str | None = None
source: str | None = None
source_label: str | None = None
tone: str = ChangeTone.NEUTRAL.value
target_id: uuid.UUID | None = None
target_value: str | None = None
scan_id: uuid.UUID | None = None
watch_id: uuid.UUID | None = None
platform: str | None = None
handle: str | None = None
program_name: str | None = None
class ChangeDay(BaseModel):
date: str
counts: dict[str, int] = Field(default_factory=dict)
class ChangeFeed(BaseModel):
since: datetime
basis: str
marked_at: datetime | None = None
window: str | None = None
counts: dict[str, int] = Field(default_factory=dict)
daily: list[ChangeDay] = Field(default_factory=list)
items: list[ChangeItem] = Field(default_factory=list)
truncated: bool = False
class ChangeMark(BaseModel):
marked_at: datetime