Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .claude/skills/run-postgres-integration-tests/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: run-postgres-integration-tests
description: Run AgentsView PostgreSQL integration and backend-parity tests against a dedicated disposable local database. Use for pgtest failures, PostgreSQL storage changes, or release gates that require TEST_PG_URL.
---

# Run PostgreSQL integration tests

1. Read `docs/agents/testing.md`, `docs/agents/storage.md`, and
`docs/agents/build.md`.
2. Never use production, shared, or persistent archive databases. The tests
drop and recreate test schemas.
3. Create a unique cluster below `$env:TEMP`, bind it only to `127.0.0.1`, and
use a free non-default port. Initialize it with PostgreSQL 17 `initdb`, UTF-8,
locale `C`, user `postgres`, and local trust authentication.
4. Start with `pg_ctl -w`, create a dedicated `agentsview_test` database, and
verify the database and server version with `psql`.
5. Set `TEST_PG_URL` only in the test process. Set `CGO_ENABLED=1` and verify
the compiler target is `x86_64-w64-mingw32` before running Go.
6. Run the smallest gate first:

```powershell
go test -tags 'fts5,pgtest' ./internal/postgres/... -run '^TestIssueReviewRowsConditionallyLoadsResultTail$' -v -count=1
```

7. Run the full canonical gate only after the focused test passes:

```powershell
go test -tags 'fts5,pgtest' ./internal/postgres/... -json -count=1
```

For large output, retain only failed test events and nearby output in the
conversation. Keep the unfiltered JSON outside Git if exact diagnosis is
needed.
8. Do not repeat a failure unchanged. Identify the failing test, then rerun
that test with `-run '^ExactTestName$'` before another full suite.
9. Stop the exact scratch server with `pg_ctl -w stop -t 360`. A full suite can
leave a large checkpoint that legitimately exceeds 30 seconds; while the
log shows checkpoint progress, wait instead of killing the process. Remove
the cluster only after resolving the absolute path and proving it is a child
named `agentsview-pgtest-*` below `$env:TEMP`. Preserve logs on failure until
the cause is recorded.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "PostgreSQL Integration Tests"
short_description: "Run isolated PostgreSQL parity tests safely"
default_prompt: "Use $run-postgres-integration-tests to run the PostgreSQL integration suite against a disposable local database."
66 changes: 66 additions & 0 deletions docs/insights.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,72 @@ live under the **More** dropdown as of 0.21.0, which leaves

![Insights page](/assets/generated/screenshots/insights.png)

## Proactive Issue Review

The top of the Insights page continuously ranks recurring problems and
automation opportunities across the selected chats. It is deterministic and
server-backed; generating an AI insight is not required. The review detects:

- failed commands, edits, builds, tests, migrations, Git/GitHub operations,
missing files or dependencies, permissions, network errors, timeouts, and
tool crashes;
- a successful retry after a failed identical call, persistent repeated waits
or polling, and the
same substantial workflow repeated across chats or projects;
- slow non-wait tools, exact-normalized user requests repeated across chats,
explicit user corrections, and assistant-reported blockers;
- allowlisted Codex response, tool-router, hook, session, and PowerShell
snapshot failures when local telemetry is available.

When an `exec` wrapper calls only one nested tool, Issue Review attributes the
finding and duration to that nested tool. Mixed-tool wrappers remain attributed
to `exec` because the outer result cannot identify one responsible tool.

The global date, project, machine, agent, termination, automation, and
one-shot filters apply first. The panel adds exact chat, folder, category, tool,
outcome, severity, confidence, status, suggested-action, and minimum-occurrence
filters. Each finding keeps at most five redacted evidence excerpts and links
to the exact message ordinal when one exists. Results are returned in pages of
100; **Load more findings** continues through the full filtered result set.

You can name and save up to 50 complete Issue Review filter sets. Selecting a
saved view restores its filters and refreshes the results. Saving the same name
updates that view, and deleting it removes only the preset. Saved views stay in
the current browser profile; they are not stored in the archive or synced
between devices.

The panel refreshes when its filters or the global scope changes, after a
debounced data-sync event, every hour while open, and on manual retry.
Background refreshes use the one-hour analysis cache so frequent sync events
cannot trigger repeated full-archive scans; **Refresh now** bypasses the cache.
If a refresh fails, the last successful result remains visible with a warning.
Acknowledgement and suppression decisions are loaded separately on every
request, so they take effect immediately without invalidating or mutating the
cached detector result. Acknowledgements reopen when a finding appears on a
later date. Suppression can last 1, 7, or 30 days, or remain permanent; hidden
findings stay available through the review-state filter.

Durations are measured only when start and completion events can be paired.
For slow tools, occurrences count calls at least 30 seconds long, while p95 is
calculated from every measured sample for that tool. Coverage is measured
samples divided by all scoped calls for the tool. The “excess” duration is a
triage proxy above 30 seconds, not a claim that all of that time was wasted.
Wait/sleep tools and negative or malformed durations are excluded.

Large tool results retain bounded context from both the beginning and end, so a
stable compiler, test, or command error near the tail remains classifiable.

The optional Codex supplement reads `~/.codex/logs_2.sqlite` in read-only mode
only for scoped session IDs and exact tool-call IDs. This supplement is
available only with the local SQLite store; PostgreSQL and DuckDB use timing
events already mirrored into their own stores. Telemetry and chat/tool
excerpts are redacted before the API returns them. The panel shows a non-blocking
warning when local telemetry is missing or unavailable; chat and tool-result
analysis remains active.

See [Proactive Issue Review handover](issue-review-handover.md) for the detector
architecture, validation matrix, deployment gates, and follow-up roadmap.

## Insight Types

There are three generation modes, selected from the dropdown at
Expand Down
6 changes: 5 additions & 1 deletion docs/internal/session-format-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ Grok section and remove the explicit registry exception in the coverage test.
trees, so this evidence does not establish IDE, desktop, or `codex exec`
activity-hint coverage. Locally observed Codex app builds can write the same
schema, but that is observational evidence rather than a public
compatibility guarantee. Agentsview derives the hint path as
compatibility guarantee. Reverified 2026-08-08 against local desktop
rollouts: `event_msg` records with `payload.type="agent_message"`,
`phase="commentary"`, and `message` are ordered assistant progress updates;
Agentsview preserves them as assistant messages with
`source_subtype="commentary"`. Agentsview derives the hint path as
`<configured-sessions-root>/../history.jsonl`; a custom sessions root
without that sibling, or `HistoryPersistence::None`, degrades to ordinary
watcher behavior, degraded-coverage polling when applicable, and the daily
Expand Down
Loading