Introducing a new way to review your PRs.

Read the announcement

mvanhorn / last30days-skill

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

View on GitHub

21 documents · Updated Nov 20, 2026

docs / patent-research-mode

Patent research mode

Patent research mode adds a bounded US patent search to a company research run. It turns company-name matches from USPTO Patent Public Search into a separate evidence artifact, selects a small set of filings for text reading, renders a ## Patent Digest, and gives the host enough evidence to decide whether a filing is worth a short patent signal. It does not rank patent filings as ordinary research items or decide what an invention means. See Research skill execution, Research planning and querying, Source retrieval and connectors, Research quality and ranking, Briefings and rendered output, and Evaluation and regression suite.

Patent research flow

The patent path runs beside the main evidence pipeline. It starts only for supported company runs, searches the company's filing names in a date window, reads selected publication records, and attaches the result to the shared report before rendering.

flowchart LR
    A[Company topic] --> B[Activation and company scope]
    B --> C[USPTO publication lists]
    C --> D[Name and publication classification]
    D --> E[Selected filing text]
    E --> F[Patent artifact]
    F --> G[Patent Digest and footer]
    G --> H[Host signal judgment]
    H --> I[Company briefing or report]
    C --> J[Counts-only outcome]
    J --> G

Activation and company scope

Patent mode is active for the main topic when the run has a company target and is a normal, non-quick research run. The command resolves the company before retrieval so the lane can search the company's known names rather than only the topic text. For a person topic, the target is the company that person leads; the filing evidence remains the company's evidence.

The lane does not start for comparison, mock, hiring-signals, or quick runs. Source exclusion and LAST30DAYS_NO_PATENT_DIGEST disable the search itself. A host-provided company name is used only when company resolution found no company. Hosted runs do not start this local lane. The company lookup is also skipped when every company-dependent lane is excluded or when no remaining lane can run.

The fetch starts beside the main research pipeline and receives the report's own date window. Collection waits only within the patent lane's bounded time, then records a patent artifact or a typed degraded result without holding the full report open.

Run conditionPatent result
Resolved company in a normal topic runSearch the resolved company and its known filing names
Person topic with a led companySearch the led company's filings and label the relationship
--company fallback without a resolved companySearch the first host company name
Comparison, mock, hiring-signals, or quick runNo patent search
Excluded source or patent-disable environmentNo patent search

References: skills/…/last30days.py• L1138-1210 skills/…/last30days.py• L4757-4777 tests/test_patents_activation.py• L153-195 tests/test_patents_activation.py• L246-294 tests/test_patents_activation.py• L405-425

Publication data retrieval

The lane uses USPTO Patent Public Search as a source of US publication and grant records. It searches published applications by applicant name and grants by assignee name for the report window. A small search over the prior year supplies recent CPC class activity when the lane can use it to choose varied filings for reading.

The lane separates company identity from name similarity. A confirmed filing name belongs to the company under the resolver's name rules. A name-matched name extends the company name but may belong to another business, so its filings stay visibly separate. Other returned names are counted as search observations but are not included as company evidence.

The lane also separates a first US publication from later or unrelated publication events. A first US publication is an application or a grant with no earlier publication that does not continue an older application. Continuations, divisionals, grants of already published applications, design patents, and other kinds remain counts but do not enter the filing evidence list.

Selection resultRole in the artifact
Confirmed company filingsCompany counts and candidate filings
Name-matched filingsSeparate counts and marked entries; not part of company totals
First US publicationsCandidate pool for text and title evidence
Later grants, continuations, designs, and other kindsCounts only
Unread or unrelated returned namesSearch notes, not digest filings

References: skills/…/patents.py• L1-40 skills/…/patents.py• L276-367 skills/…/patents.py• L633-732 tests/test_patents_selection.py• L96-125 tests/test_patents_selection.py• L245-277

Filing text selection

The artifact is a bounded evidence package, not a complete patent archive. The lane reads text for at most a small set of first-publication candidates. It favors recent work and, when the prior-year sample is usable, gives part of the set to CPC subclasses the company has used least recently. Confirmed subsidiary or operating-company names can receive reserved representation so the parent name does not hide all related filers.

Each detailed filing can carry its title, publication and filing dates, earliest priority date, CPC classes, filing entity and location, abstract, and first claim. Remaining first publications can appear as linked titles only. If a detail request fails, times out, or the lane budget ends, the artifact keeps counts and title evidence and marks the missing text.

The lane has one overall time budget and bounded requests. A USPTO sign-in refusal is distinct from a source error. A successful list search with no qualifying filings is also distinct from either failure.

References: skills/…/patents.py• L69-98 skills/…/patents.py• L497-543 skills/…/patents.py• L735-799 tests/test_patents_selection.py• L638-709 tests/test_patents_client.py• L398-445

Patent artifact states

The shared report stores the successful result under the patents artifact key. A digest artifact contains counts, filer groups, detailed entries, title-only index items, the requested window, and any partial-text note. A counts-only artifact records useful filing totals when no first-publication text or title evidence remains. No artifact is attached for a clean empty result or an ignored sign-in refusal.

The counts have a narrow meaning. Company totals exclude name-matched filings, while name-matched first publications remain available with an explicit marker. A floor flag means the source list was larger than the bounded search and the displayed counts are lower bounds. This lets downstream output show uncertainty instead of treating a capped search as complete.

References: skills/…/patents.py• L161-187 skills/…/patents.py• L226-260 skills/…/patents.py• L336-367 tests/test_patents_selection.py• L20-34 tests/test_patents_client.py• L277-297

Digest and signal surfaces

The patent artifact has two reader surfaces. The digest carries evidence for host synthesis. The footer carries compact counts even when the digest has no readable filing text.

Digest construction

## Patent Digest is an engine-authored evidence block built from the artifact. It presents the window and company counts first, separates other filers whose names resemble the company, then shows detailed first publications and a title-only list. It keeps the block below a fixed size by shortening the title list first and reports omitted entries or missing text in a note.

Patent-office titles, names, abstracts, and claims are untrusted source data. The renderer flattens and escapes them before insertion. Filing titles link to the USPTO document URL when the URL passes the normal link safety checks. The digest therefore exposes useful evidence without allowing retrieved text to create headings, links, instructions, or output boundaries.

The block appears in compact and full report output after the jobs digest and before ranked evidence. The patent footer is separate from the digest. It reports applications, grants, and first US publications from the company's own names, or identifies the filing names when only name-matched filers were found.

References: skills/…/patent_digest.py• L20-25 skills/…/patent_digest.py• L74-167 skills/…/render.py• L909-917 skills/…/render.py• L2595-2647 tests/test_patent_digest.py• L205-239 tests/test_render_patents.py• L99-131

Patent signal extraction

Patent Secret Signals are a host-synthesis step, not an automatic interpretation in the patent lane. The host may consider only a detailed first-publication entry or a valid cluster of such entries. The abstract and first claim must describe something concrete that a reader can picture. A candidate must also be outside the company's known work or describe a recognisable product or feature that the company has not shipped, announced, or had reported in a leak.

The host checks the strongest concrete candidates on the web before it keeps or drops them. A product match removes the unshipped-product path. Coverage changes the wording but does not by itself prove novelty. A story connection can explain why a valid signal matters, but it cannot qualify a filing by itself. A titles-only entry, a continuation, a divisional, an earlier-published grant, or a design patent is never a signal.

The section is omitted when there is no digest, no concrete candidate, no web search, or no qualifying signal. Standard company reports allow one signal by default and at most two when both qualify without a matching product. Jobs signals use the first part of the shared report cap, so a report with two job signals leaves room for one patent paragraph.

References: skills/…/patent-signals.md• L21-66 skills/…/patent-signals.md• L74-78 skills/…/report_checklist.py• L164-185 tests/patent_signals_rule.py• L65-119 tests/patent_signals_rule.py• L167-199

Pipeline integration

Patent evidence integrates with the broader research pipeline as an optional report artifact. It does not enter normal source normalization, ranking, clustering, source totals, voice statistics, or freshness scoring. This keeps a patent filing from competing with time-bound discussion evidence while still making the filing available to the host.

The main pipeline completes its report first, then patent collection attaches the artifact. Rendering reads that artifact directly. The digest and footer can therefore accompany ranked research without changing the ranked result, and an excluded patent source removes only the patent surfaces.

The patent section is intended for normal company-report synthesis. It is not rendered in comparison output, and the signal checklist does not ask for patent checks in recommendation or exec output. A daily or weekly briefing can use findings created from the report, but the patent artifact itself is not a stored finding or a ranking result.

References: skills/…/last30days.py• L4769-4777 skills/…/last30days.py• L4822-4855 tests/test_render_patents.py• L181-230 tests/test_render_patents.py• L339-384 skills/…/patent-signals.md• L23-29

Evaluation fixtures

Patent coverage uses offline tests at three levels. Client tests replay recorded USPTO session, list, and detail responses. Selection tests check identity grouping, publication classes, counts, text selection, and partial outcomes. Rendering tests check digest order, footer counts, safe evidence handling, output placement, and the rule that patents do not alter unrelated report statistics.

The signal contract has a different purpose. tests/…/patent_signals_labelled.json contains constructed cases for the signal rules. tests/patent_signals_rule.py checks the arithmetic for usable filings, concrete candidates, clusters, web-check obligations, signal caps, and paragraph shape. tests/test_patent_signals_contract.py also checks that the reference text states those rules. These fixtures do not prove that a model finds the right filing or judges a live patent correctly; that requires a human review of a live run.

Together, the fixtures protect the handoffs from activation to source retrieval, artifact shape, digest rendering, and bounded host judgment. They keep source replay deterministic while leaving open-web interpretation outside the unit-test claim.

References: tests/test_patents_client.py• L1-29 tests/test_patents_selection.py• L58-75 tests/test_patent_digest.py• L447-452 tests/test_render_patents.py• L339-384 tests/test_patent_signals_contract.py• L1-8 tests/test_patent_signals_contract.py• L399-485 tests/…/patent_signals_labelled.json• L1-3

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep patent activation aligned with company resolution, person-to-company mapping, comparison isolation, quick and mock modes, source exclusion, the no-patent environment switch, and the rule that unnecessary company lookup is skipped.
  • Keep the report date window aligned between the main pipeline and the USPTO searches, including the prior-year sample used for filing selection.
  • Keep confirmed, name-matched, and unrelated filing names separate across artifact counts, digest labels, footer counts, and signal eligibility.
  • Keep first-publication classification aligned with continuity data so later grants, continuations, divisionals, designs, and other kinds cannot become signal candidates.
  • Keep partial text, title-only entries, count floors, sign-in outcomes, transport failures, and budget expiry distinct across the artifact, digest note, footer, and source status.
  • Keep patent evidence escaping and link checks aligned with every rendered surface that can expose the digest or footer.
  • Keep the patent signal rules aligned with web-check limits, the jobs signal cap, report register exclusions, and the labelled fixture arithmetic.
  • Keep USPTO replay fixtures and signal fixtures offline and deterministic; do not treat their labels as a benchmark for live model judgment.

Important failure modes

TriggerConsequenceGuard
A comparison or quick run starts the patent laneOne entity's filing evidence can be mistaken for shared comparison evidence or the run can exceed its intended scopeGate the lane to normal main-topic company runs
Company lookup runs when all company-dependent lanes are disabledThe run performs needless resolution and can violate the intended source scopeSkip lookup when every such lane is excluded or no remaining lane can run
Company resolution returns a namesake or an unverified name extensionAnother business's filings can appear to belong to the topic companySeparate confirmed, name-matched, and other names, then mark name-matched entries
A capped USPTO list is treated as completeCounts and signal judgments can understate the filing setPreserve the floor flag and render lower-bound counts with +
A continuation or earlier-published grant is treated as new workThe report repeats an old invention as a new signalClassify first US publications before reading or signalling
Detail reads fail after list results succeedA digest may look complete while its abstracts or claims are missingKeep title-only entries and a missing-text note
Patent-office text is inserted as trusted MarkdownSource text can forge links, headings, instructions, or report boundariesFlatten and escape untrusted fields before rendering
A concrete filing is dropped without a web checkA valid signal can be lost, or an unsupported shipped claim can enter the reportCheck the strongest concrete candidates before deciding
Signal fixtures are read as live-world truthA passing arithmetic case can hide a bad model choiceUse fixtures for contract arithmetic and review live runs for judgment

Key files

FileWhy to read it
skills/…/last30days.pyDefines patent activation, company selection, date-window handoff, collection, and report attachment.
skills/…/patents.pyDefines the USPTO evidence lane, filing classification, candidate selection, bounded reads, and artifact states.
skills/…/patent_digest.pyDefines the digest shape, size bound, count wording, entry order, and partial-result note.
skills/…/render.pyShows where the digest and footer enter compact and full report output and how untrusted filing text is rendered.
skills/…/report_checklist.pyConnects a digest with the host's patent-signal decision work.
skills/…/patent-signals.mdStates the host-facing evidence, web-check, signal, wording, and report-scope rules.
tests/test_patents_activation.pyProtects activation gates, company and person scope, lookup avoidance, report windows, budgets, and degraded outcomes.
tests/test_patents_client.pyReplays USPTO responses and protects request, sign-in, timeout, rate-limit, and partial-read behavior.
tests/test_patents_selection.pyProtects filer grouping, publication classes, counts, CPC selection, and reserved representation.
tests/test_patent_digest.pyProtects digest order, field presentation, name matching, size limits, and counts-only behavior.
tests/test_render_patents.pyProtects report placement, footer behavior, output safety, register exclusions, and pipeline isolation.
tests/patent_signals_rule.pyEncodes the testable arithmetic for candidate eligibility, web checks, clusters, and signal limits.
tests/…/patent_signals_labelled.jsonProvides constructed labelled cases for the patent signal contract.