Skip to content

Add agentict CLI: one-time PESTLE signal monitoring for market watchlists - #6

Open
olileger with Copilot wants to merge 6 commits into
mainfrom
copilot/enable-onetime-pestle-signal-monitoring
Open

Add agentict CLI: one-time PESTLE signal monitoring for market watchlists#6
olileger with Copilot wants to merge 6 commits into
mainfrom
copilot/enable-onetime-pestle-signal-monitoring

Conversation

Copilot AI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Investors monitoring a watchlist currently have to manually crawl news/financial sites for PESTLE signals before deciding whether to invest. This adds a Python CLI (agentict) that runs once, reads a Markdown watchlist, gathers signals per (ticker, exchange), and emits a single tabular report ending in an Invest / Not / no data available verdict.

Watchlist parsing

  • New parser.py validates a # Stock exchange / # Tickers grammar; missing or misordered headings hard-fail the whole run (no partial report).
  • In-section duplicate tickers collapse to one entry; a ticker declared under 2+ exchanges is preserved as one row per exchange, each forced to no data available with a "duplicate across exchanges" reason, and skips signal collection entirely.
  • Exchange sections with zero tickers are valid and contribute no rows.

Signal collection

  • sources/ defines a SignalSource protocol with two collectors (web-search style, Yahoo-Finance style) built on requests, each wrapping every failure (network, timeout, parse) into SourceError so one source's failure never aborts a ticker's processing.
  • Orchestrator proceeds with best-effort partial signals if some sources fail; only forces no data available when all sources fail for a ticker.

Verdict via pluggable Financial Analyst agent

  • agents/base.py defines a FinancialAnalyst interface (assess(ticker, exchange, signals) -> VerdictResult) so the verdict is judgment-based rather than a fixed scoring formula.
  • Default HeuristicFinancialAnalyst is deterministic and network-free (documented as an illustrative stand-in, not a certified model); it discretionarily returns no data available when fewer than 2 of 6 PESTLE categories have usable signal or the signal is materially conflicting.
  • An optional agents/llm.py extension point is selectable via --analyst llm / AGENTICT_ANALYST=llm, with lazy SDK import so it's never a hard dependency.
  • Signal aggregation keeps uncategorized source text in a distinct bucket rather than broadcasting it across all 6 PESTLE categories, so a single uncategorized source can't trivially satisfy the multi-category coverage check or skew keyword tallies.

Report and CLI

  • report.py renders a plain-text Ticker/Exchange/Verdict/Reason table and always prepends a mandatory AI-generated/informational-only disclaimer.
  • agentict monitor --file <path>.md [--output <path>] [--analyst heuristic|llm]; exit codes: 0 success, 2 usage/malformed-watchlist error (no report emitted), 1 unexpected error.

Packaging and CI

  • pyproject.toml (hatchling, src/ layout, requires-python>=3.10, only runtime dependency is requests), console script agentict.
  • .github/workflows/python-ci.yml runs pytest on ubuntu-latest and windows-latest.
$ agentict monitor --file watchlist.md
DISCLAIMER: This report is generated by an automated AI system...

Ticker | Exchange | Verdict           | Reason
-------+----------+-------------------+------------------------------------------
AAPL   | NASDAQ   | Invest            | Positive keyword signal (3) outweighs...
GOOGL  | NASDAQ   | no data available | duplicate across exchanges: 'GOOGL'...

Includes unit test coverage for the parser grammar, dedup/cross-exchange handling, orchestrator failure modes, heuristic agent branches, and report rendering.

Copilot AI and others added 4 commits August 21, 2026 17:33
…ial analyst agent, report)

Co-authored-by: olileger <13554171+olileger@users.noreply.github.com>
Co-authored-by: olileger <13554171+olileger@users.noreply.github.com>
Co-authored-by: olileger <13554171+olileger@users.noreply.github.com>
…gories

Co-authored-by: olileger <13554171+olileger@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable one-time PESTLE signal monitoring for market watchlists via CLI Add agentict CLI: one-time PESTLE signal monitoring for market watchlists Aug 21, 2026
Copilot AI requested a review from olileger August 21, 2026 17:47
@olileger

Copy link
Copy Markdown
Owner

@copilot update the prject's README file to explain how to use that new feature (installation, run example)

Co-authored-by: olileger <13554171+olileger@users.noreply.github.com>

Copilot AI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update the prject's README file to explain how to use that new feature (installation, run example)

Added a "agentict CLI: one-time PESTLE signal monitoring" section to the README covering installation, watchlist format, usage, and exit codes.

@olileger
olileger marked this pull request as ready for review August 21, 2026 18:24
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.

[Product Request] Enable one-time PESTLE signal monitoring for market watchlists via CLI

2 participants