prism-search 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- prism_search-0.2.0/.github/workflows/ci.yml +67 -0
- prism_search-0.2.0/.github/workflows/release.yml +88 -0
- prism_search-0.2.0/.gitignore +26 -0
- prism_search-0.2.0/AGENTS.md +31 -0
- prism_search-0.2.0/CHANGELOG.md +102 -0
- prism_search-0.2.0/CONTRIBUTING.md +31 -0
- prism_search-0.2.0/LICENSE +21 -0
- prism_search-0.2.0/PKG-INFO +70 -0
- prism_search-0.2.0/README.ja.md +243 -0
- prism_search-0.2.0/README.ko.md +243 -0
- prism_search-0.2.0/README.md +243 -0
- prism_search-0.2.0/README.zh-CN.md +243 -0
- prism_search-0.2.0/benchmarks/README.md +48 -0
- prism_search-0.2.0/benchmarks/RELEASE_QUALITY.md +46 -0
- prism_search-0.2.0/benchmarks/eval_suite.jsonl +40 -0
- prism_search-0.2.0/benchmarks/metrics.py +170 -0
- prism_search-0.2.0/benchmarks/results/observations.json +1 -0
- prism_search-0.2.0/benchmarks/results/report.md +76 -0
- prism_search-0.2.0/benchmarks/results/summary.json +81 -0
- prism_search-0.2.0/benchmarks/results-neural/observations.json +1 -0
- prism_search-0.2.0/benchmarks/results-neural/report.md +76 -0
- prism_search-0.2.0/benchmarks/results-neural/summary.json +81 -0
- prism_search-0.2.0/benchmarks/run_eval.py +382 -0
- prism_search-0.2.0/benchmarks/verify_eval.py +378 -0
- prism_search-0.2.0/benchmarks/verify_suite_100.jsonl +100 -0
- prism_search-0.2.0/docs/ARCHITECTURE.md +192 -0
- prism_search-0.2.0/docs/EXTERNAL_REFERENCES.md +117 -0
- prism_search-0.2.0/docs/PYPI.md +31 -0
- prism_search-0.2.0/docs/RELEASE.md +87 -0
- prism_search-0.2.0/docs/SKILL_DRAFT.md +17 -0
- prism_search-0.2.0/docs/assets/prism.svg +12 -0
- prism_search-0.2.0/docs/assets/social-preview.png +0 -0
- prism_search-0.2.0/docs/assets/terminal-demo.svg +27 -0
- prism_search-0.2.0/pyproject.toml +81 -0
- prism_search-0.2.0/server.json +27 -0
- prism_search-0.2.0/src/prism_search/__init__.py +26 -0
- prism_search-0.2.0/src/prism_search/_pdf_worker.py +43 -0
- prism_search-0.2.0/src/prism_search/browser.py +425 -0
- prism_search-0.2.0/src/prism_search/cli.py +1095 -0
- prism_search-0.2.0/src/prism_search/contracts.py +286 -0
- prism_search-0.2.0/src/prism_search/egress.py +268 -0
- prism_search-0.2.0/src/prism_search/embedder.py +417 -0
- prism_search-0.2.0/src/prism_search/evidence.py +145 -0
- prism_search-0.2.0/src/prism_search/fetcher.py +1527 -0
- prism_search-0.2.0/src/prism_search/pipelines/__init__.py +1 -0
- prism_search-0.2.0/src/prism_search/pipelines/frontier.py +1548 -0
- prism_search-0.2.0/src/prism_search/pipelines/similar.py +495 -0
- prism_search-0.2.0/src/prism_search/pipelines/verify.py +1450 -0
- prism_search-0.2.0/src/prism_search/providers/__init__.py +115 -0
- prism_search-0.2.0/src/prism_search/providers/_endpoint.py +130 -0
- prism_search-0.2.0/src/prism_search/providers/base.py +278 -0
- prism_search-0.2.0/src/prism_search/providers/bing.py +269 -0
- prism_search-0.2.0/src/prism_search/providers/bing_news.py +213 -0
- prism_search-0.2.0/src/prism_search/providers/community.py +213 -0
- prism_search-0.2.0/src/prism_search/providers/ddg.py +63 -0
- prism_search-0.2.0/src/prism_search/providers/gnews.py +208 -0
- prism_search-0.2.0/src/prism_search/providers/naver.py +537 -0
- prism_search-0.2.0/src/prism_search/providers/registry.py +349 -0
- prism_search-0.2.0/src/prism_search/providers/research.py +367 -0
- prism_search-0.2.0/src/prism_search/providers/searxng.py +73 -0
- prism_search-0.2.0/src/prism_search/providers/wikidata.py +185 -0
- prism_search-0.2.0/src/prism_search/providers/wikipedia.py +437 -0
- prism_search-0.2.0/src/prism_search/providers/yahoo_jp.py +182 -0
- prism_search-0.2.0/src/prism_search/regions/eu.yaml +49 -0
- prism_search-0.2.0/src/prism_search/regions/global.yaml +45 -0
- prism_search-0.2.0/src/prism_search/regions/jp.yaml +51 -0
- prism_search-0.2.0/src/prism_search/regions/kr.yaml +61 -0
- prism_search-0.2.0/src/prism_search/regions/us.yaml +47 -0
- prism_search-0.2.0/src/prism_search/regions.py +109 -0
- prism_search-0.2.0/src/prism_search/sdk.py +188 -0
- prism_search-0.2.0/src/prism_search/security.py +547 -0
- prism_search-0.2.0/src/prism_search/server.py +212 -0
- prism_search-0.2.0/src/prism_search/signals.py +1026 -0
- prism_search-0.2.0/src/prism_search/skill/SKILL.md +93 -0
- prism_search-0.2.0/src/prism_search/skill_install.py +97 -0
- prism_search-0.2.0/src/prism_search/store.py +1085 -0
- prism_search-0.2.0/src/prism_search/temporal.py +1194 -0
- prism_search-0.2.0/src/prism_search/tools.py +256 -0
- prism_search-0.2.0/tests/fixtures/yahoo_jp_search.html +7 -0
- prism_search-0.2.0/tests/fixtures/yahoo_us_search.html +1 -0
- prism_search-0.2.0/tests/smoke_distribution.py +91 -0
- prism_search-0.2.0/tests/test_application_window.py +108 -0
- prism_search-0.2.0/tests/test_benchmark.py +159 -0
- prism_search-0.2.0/tests/test_bing_coherence.py +89 -0
- prism_search-0.2.0/tests/test_bing_news.py +89 -0
- prism_search-0.2.0/tests/test_cli_ux.py +147 -0
- prism_search-0.2.0/tests/test_crossref_and_pubmed.py +163 -0
- prism_search-0.2.0/tests/test_extraction_budget.py +95 -0
- prism_search-0.2.0/tests/test_fetch_honest_retry.py +58 -0
- prism_search-0.2.0/tests/test_fetcher_and_quorum.py +317 -0
- prism_search-0.2.0/tests/test_fetcher_chrome.py +216 -0
- prism_search-0.2.0/tests/test_package_registry.py +188 -0
- prism_search-0.2.0/tests/test_pdf_markdown_browser.py +683 -0
- prism_search-0.2.0/tests/test_phase2_entrypoints.py +634 -0
- prism_search-0.2.0/tests/test_phase2_frontier.py +548 -0
- prism_search-0.2.0/tests/test_phase2_providers.py +469 -0
- prism_search-0.2.0/tests/test_phase2_similar.py +322 -0
- prism_search-0.2.0/tests/test_regions_and_embedder.py +199 -0
- prism_search-0.2.0/tests/test_release_hardening.py +333 -0
- prism_search-0.2.0/tests/test_render_egress_and_redos.py +447 -0
- prism_search-0.2.0/tests/test_sdk.py +293 -0
- prism_search-0.2.0/tests/test_searxng.py +94 -0
- prism_search-0.2.0/tests/test_security_temporal_store.py +1059 -0
- prism_search-0.2.0/tests/test_signals_and_providers.py +916 -0
- prism_search-0.2.0/tests/test_skill_install.py +166 -0
- prism_search-0.2.0/tests/test_term_ranking.py +365 -0
- prism_search-0.2.0/tests/test_title_terms.py +115 -0
- prism_search-0.2.0/tests/test_user_agent.py +26 -0
- prism_search-0.2.0/tests/test_verify_pipeline.py +1449 -0
- prism_search-0.2.0/tests/test_wikipedia_query.py +55 -0
- prism_search-0.2.0/tests/test_yahoo_jp.py +185 -0
- prism_search-0.2.0/uv.lock +2418 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
PRISM_AUTO_DOWNLOAD_MODEL: "false"
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
test:
|
|
22
|
+
runs-on: ${{ matrix.os }}
|
|
23
|
+
timeout-minutes: 10
|
|
24
|
+
strategy:
|
|
25
|
+
fail-fast: false
|
|
26
|
+
matrix:
|
|
27
|
+
os:
|
|
28
|
+
- ubuntu-latest
|
|
29
|
+
- macos-latest
|
|
30
|
+
- windows-latest
|
|
31
|
+
python-version:
|
|
32
|
+
- "3.11"
|
|
33
|
+
- "3.12"
|
|
34
|
+
- "3.13"
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
37
|
+
with:
|
|
38
|
+
persist-credentials: false
|
|
39
|
+
- uses: astral-sh/setup-uv@36300bab3f61b84e19f32b6bd26b7897f3c7e951 # v10.4.2
|
|
40
|
+
with:
|
|
41
|
+
python-version: ${{ matrix.python-version }}
|
|
42
|
+
enable-cache: true
|
|
43
|
+
- run: uv sync --locked --extra dev
|
|
44
|
+
- run: uv run ruff format --check .
|
|
45
|
+
- run: uv run ruff check .
|
|
46
|
+
- run: uv run pytest -W error -o addopts="" -v --tb=short
|
|
47
|
+
- run: uv run python benchmarks/verify_eval.py --offline
|
|
48
|
+
|
|
49
|
+
package:
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
timeout-minutes: 15
|
|
52
|
+
needs: test
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
55
|
+
with:
|
|
56
|
+
persist-credentials: false
|
|
57
|
+
- uses: astral-sh/setup-uv@36300bab3f61b84e19f32b6bd26b7897f3c7e951 # v10.4.2
|
|
58
|
+
with:
|
|
59
|
+
python-version: "3.12"
|
|
60
|
+
- run: uv build
|
|
61
|
+
- name: Smoke test the wheel, source distribution, and MCP profiles
|
|
62
|
+
run: uv run --no-project python tests/smoke_distribution.py dist
|
|
63
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
|
|
64
|
+
with:
|
|
65
|
+
name: dist
|
|
66
|
+
path: dist/
|
|
67
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish-pypi:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 15
|
|
15
|
+
environment: pypi
|
|
16
|
+
permissions:
|
|
17
|
+
id-token: write
|
|
18
|
+
contents: read
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
- uses: astral-sh/setup-uv@36300bab3f61b84e19f32b6bd26b7897f3c7e951 # v10.4.2
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
enable-cache: true
|
|
27
|
+
- name: Verify release tag matches package and registry metadata
|
|
28
|
+
env:
|
|
29
|
+
TAG_NAME: ${{ github.ref_name }}
|
|
30
|
+
run: |
|
|
31
|
+
uv run --no-project python - <<'PY'
|
|
32
|
+
import json
|
|
33
|
+
import os
|
|
34
|
+
import re
|
|
35
|
+
import tomllib
|
|
36
|
+
from pathlib import Path
|
|
37
|
+
|
|
38
|
+
tag_ver = os.environ["TAG_NAME"].removeprefix("v")
|
|
39
|
+
pyproject_ver = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
|
|
40
|
+
init_text = Path("src/prism_search/__init__.py").read_text()
|
|
41
|
+
m = re.search(r'^__version__\s*=\s*"([^"]+)"', init_text, re.M)
|
|
42
|
+
assert m is not None, "__version__ not found"
|
|
43
|
+
init_ver = m.group(1)
|
|
44
|
+
|
|
45
|
+
server = json.loads(Path("server.json").read_text())
|
|
46
|
+
server_ver = server["version"]
|
|
47
|
+
pkg_ver = server["packages"][0]["version"]
|
|
48
|
+
|
|
49
|
+
pypi_doc = Path("docs/PYPI.md").read_text()
|
|
50
|
+
expected_mcp = f"<!-- mcp-name: {server['name']} -->"
|
|
51
|
+
|
|
52
|
+
assert tag_ver == pyproject_ver == init_ver == server_ver == pkg_ver, (
|
|
53
|
+
f"Version mismatch: tag={tag_ver}, pyproject={pyproject_ver}, "
|
|
54
|
+
f"__init__={init_ver}, server={server_ver}, pkg={pkg_ver}"
|
|
55
|
+
)
|
|
56
|
+
assert expected_mcp in pypi_doc, f"Missing {expected_mcp} in docs/PYPI.md"
|
|
57
|
+
print(f"Verified version {tag_ver} and MCP ownership line {expected_mcp}")
|
|
58
|
+
PY
|
|
59
|
+
- run: uv build
|
|
60
|
+
- name: Smoke test wheel, sdist, and MCP profiles
|
|
61
|
+
run: uv run --no-project python tests/smoke_distribution.py dist
|
|
62
|
+
- name: Publish distributions to PyPI via Trusted Publishing
|
|
63
|
+
run: uv publish --trusted-publishing always dist/*
|
|
64
|
+
|
|
65
|
+
github-release:
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
timeout-minutes: 15
|
|
68
|
+
needs: publish-pypi
|
|
69
|
+
permissions:
|
|
70
|
+
contents: write
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
73
|
+
with:
|
|
74
|
+
persist-credentials: false
|
|
75
|
+
- uses: astral-sh/setup-uv@36300bab3f61b84e19f32b6bd26b7897f3c7e951 # v10.4.2
|
|
76
|
+
with:
|
|
77
|
+
python-version: "3.12"
|
|
78
|
+
enable-cache: true
|
|
79
|
+
- run: uv build
|
|
80
|
+
- name: Create GitHub Release
|
|
81
|
+
env:
|
|
82
|
+
GH_TOKEN: ${{ github.token }}
|
|
83
|
+
TAG_NAME: ${{ github.ref_name }}
|
|
84
|
+
run: |
|
|
85
|
+
gh release create "$TAG_NAME" dist/* \
|
|
86
|
+
--verify-tag \
|
|
87
|
+
--title "$TAG_NAME" \
|
|
88
|
+
--generate-notes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Python / uv
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
.venv/
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
*.egg-info/
|
|
9
|
+
.pytest_cache/
|
|
10
|
+
.ruff_cache/
|
|
11
|
+
.mypy_cache/
|
|
12
|
+
|
|
13
|
+
# Local caches / DB / models
|
|
14
|
+
*.sqlite
|
|
15
|
+
*.sqlite-wal
|
|
16
|
+
*.sqlite-shm
|
|
17
|
+
*.db
|
|
18
|
+
.cache/
|
|
19
|
+
|
|
20
|
+
# OS / Editor / Local Agent State
|
|
21
|
+
.DS_Store
|
|
22
|
+
.vscode/
|
|
23
|
+
.idea/
|
|
24
|
+
.env
|
|
25
|
+
.env.*
|
|
26
|
+
.commandcode/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# AGENTS.md — prism-search
|
|
2
|
+
|
|
3
|
+
> **Prism Search (`prism-search`)** — Zero-API-key, zero-Docker, zero-hardcoded-keywords, MIT-licensed **Adaptive Progressive Frontier Web Search MCP + CLI + Agent Skill**.
|
|
4
|
+
> Canonical architecture: `docs/ARCHITECTURE.md` (v0.3 Final). External audit: `docs/EXTERNAL_REFERENCES.md`.
|
|
5
|
+
|
|
6
|
+
## Project Identity & Non-Negotiables
|
|
7
|
+
|
|
8
|
+
1. **100% Free Core Forever (Zero Paywall Invariant):**
|
|
9
|
+
- Out-of-the-box workflows MUST run with **0 API keys**, **0 paid SaaS accounts**, **0 logins**, and **0 Docker containers**.
|
|
10
|
+
- Paid SaaS search APIs are permanently excluded. Strictly optional **zero-cost official enhancers** (`NAVER_CLIENT_ID`/`NAVER_CLIENT_SECRET` 25k/day free, local `GH_TOKEN`, local `PRISM_SEARXNG_URL`) may be opted into for reliability without ever being required.
|
|
11
|
+
2. **Zero Hardcoded Domain Keyword Lists:**
|
|
12
|
+
- Never hardcode domain or seasonal word tables inside the engine.
|
|
13
|
+
- Use **Live Context Anchoring (`now_context`)** + **Declarative Region Packs (`regions/*.yaml`)** + **Host LLM / Server-Side Emergent Signal Expansion** to widen search frontiers dynamically.
|
|
14
|
+
3. **Domain-Agnostic 4 Orthogonal Axes:**
|
|
15
|
+
- Never over-fit to a single vertical (e.g., survey events). Parameterize every search by 4 orthogonal axes: `temporality`, `authority`, `discovery_mode`, and `region/langs`.
|
|
16
|
+
4. **Compact MCP Surface & Instant Cold Start:**
|
|
17
|
+
- Keep default MCP surface to **5 tools** (`search_frontier`, `expand_frontier`, `find_similar`, `verify_urls`, `inspect_evidence`; `tools/list < 6 KB`), plus `--mode verify` (`verify_urls`, `inspect_evidence`) and `--mode search` profiles, and the `prism-verify` CLI entrypoint.
|
|
18
|
+
- Cold start `< 200 ms`. Never block the first MCP tool call on a 120 MB ONNX download — answer immediately in `lexical_fallback` while warming ONNX asynchronously (or pre-warm via `prism-search setup`).
|
|
19
|
+
5. **Evidence & Epistemic Honesty (Adopted from REA & Craft Anything):**
|
|
20
|
+
- Enforce **summary-first + retained SQLite handles (`ev_<id>` / `fr_<id>`)**.
|
|
21
|
+
- Tag every field clearly as `observed` (verbatim excerpt, URL, date span, SHA-256), `derived` (scores, `temporal_status`, `source_class`, Q-IDs), or `inferred` (emergent terms & hubs).
|
|
22
|
+
- Always emit `coverage` and `saturation_diagnosis`. Never silently drop rate-limited, expired, or `JS_REQUIRED` pages.
|
|
23
|
+
6. **Security, Privacy & Public Repo Hygiene:**
|
|
24
|
+
- Enforce 4-step DNS-resolved SSRF blocking, `≤ 5` redirects, `≤ 2 MiB` streaming cap, login/captcha/SPA shell filtering, credential scrubbing, differential TTL, 256 MB LRU cache cap, and `--ephemeral` mode.
|
|
25
|
+
- Keep 100% offline-testable via recorded HTTP fixtures and completely free of personal paths or internal references.
|
|
26
|
+
|
|
27
|
+
## Canonical Documents
|
|
28
|
+
|
|
29
|
+
- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — v0.3 Final Engineering Specification
|
|
30
|
+
- [docs/EXTERNAL_REFERENCES.md](docs/EXTERNAL_REFERENCES.md) — Verified OSS & Live Keyless Probe Audit
|
|
31
|
+
- [docs/SKILL_DRAFT.md](docs/SKILL_DRAFT.md) — Companion Multi-Agent Skill Specification
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes are listed here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses [Semantic Versioning](https://semver.org/). Versions before 1.0 can change the tool and CLI contracts between minor releases.
|
|
4
|
+
|
|
5
|
+
## [0.2.0] — Unreleased
|
|
6
|
+
|
|
7
|
+
First public release candidate.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `verify_urls` MCP tool, `prism-search verify` and `prism-verify` CLI commands, and the `verify()` / `PrismClient.averify()` SDK. Verify up to 50 input URLs (HTML and public PDFs via `pypdf`), follow relevant hub links, extract schema.org facts, add public GitHub and registry metadata, and retain the evidence for later inspection.
|
|
12
|
+
- Clean structured Markdown extraction (`content_markdown` stored in SQLite, `prism-verify --format markdown`, and `inspect_evidence --view markdown`) preserving GFM tables, fenced code blocks, headings, and resolved links.
|
|
13
|
+
- Optional local headless browser fallback (`--render auto|always`, `PRISM_RENDER`, and the SDK `render=` argument) using system Chrome/Chromium/Edge/Brave or the optional `prism-search[browser]` Playwright extra. Every browser request, including redirect hops, subresources and script requests, goes through a loopback egress proxy that applies the same SSRF check and connects to the checked address. A render that reaches a private or non-public address is refused (`SSRF_BLOCKED`). The browser runs with a temporary profile. `render` is not an MCP argument: a host model or page text cannot switch the browser on; MCP server operators can set `PRISM_RENDER`.
|
|
14
|
+
- MCP tool profiles via `--mode full|search|verify` on `prism-search serve` (`prism-verify serve` defaults to `verify`, exposing only `verify_urls` and `inspect_evidence` for agents that already have web search).
|
|
15
|
+
- `package_registry` source (17 built-in keyless sources total): for `versioned` goals, queries PyPI, npm, crates.io and RubyGems (0 keys) to read official registry pages, changelogs and release lists.
|
|
16
|
+
- `source_facts` and `version_trace` on verified results and versioned searches (`source says: …`, `page shows: …`).
|
|
17
|
+
- Python SDK: `prism_search.search()`, `prism_search.verify()`, `prism_search.extract()` and `prism_search.PrismClient` with async methods (`asearch`, `aexpand`, `asimilar`, `averify`, `ainspect`, `aextract`).
|
|
18
|
+
- Time budget for searches: `time_budget_s` (`2–30 s`) on `search_frontier` and `expand_frontier` (`2–45 s` on `verify_urls`), and `--budget S` / `--fast` (`5 s`) in the CLI.
|
|
19
|
+
- `include_domains` (`--include-domain`) to keep only selected sites.
|
|
20
|
+
- Keyless research sources `crossref` and `pubmed` alongside `package_registry`.
|
|
21
|
+
- Offline decoding of Google News RSS article links to publisher URLs, `schema.org` event date range extraction, and Naver request spacing with mobile-page fallback.
|
|
22
|
+
- CLI `--format auto` (default: text or Markdown table in a terminal, JSON when piped), readable `inspect` text views, `--help` text + examples, and hints for `fr_`/`ev_` handles and JS/login walls.
|
|
23
|
+
- `CHANGELOG.md` and 100-case / 20-vertical cross-domain verification benchmark (`benchmarks/verify_eval.py`, `benchmarks/verify_suite_100.jsonl`).
|
|
24
|
+
|
|
25
|
+
### Security
|
|
26
|
+
|
|
27
|
+
- HTML wall and SPA-shell classifiers, temporal date/closure scans, and title/suffix regexes now run in linear time. Before this change, a 40 KB page of repeated `<div id="root" ` tags kept a five-second `verify_urls` call busy for about 42 seconds, and a 20 KB Korean whitespace flood could stall temporal parsing. A 1–2 MiB flood of any tested pattern now finishes in well under 0.2 s.
|
|
28
|
+
- Text hidden from human readers by inline style (zero or 1px font size, zero/near-zero opacity, `visibility:hidden`, transparent color, `clip-path`/`clip` hiding, zero-scale transforms, zero-size overflow-hidden boxes, or off-screen placement) is dropped before extraction, so it cannot reach agents as a verified excerpt. Tab panels hidden with `display:none` are kept. Every response now states in `epistemic_fields.untrusted` that page text is data, and the bundled skill tells agents not to follow instructions found in it.
|
|
29
|
+
- PDF extraction runs in a killable subprocess worker, inspects Form XObject `/Name Do` streams as well as page content streams, skips pages exceeding 2 MiB of decoded work, stops after 12 MiB or 4 seconds, and requires `pypdf>=7.0.0`.
|
|
30
|
+
- System-Chrome stdout is read in bounded chunks (killing the process immediately above 2 MiB), the egress proxy enforces `MAX_REDIRECTS` (5 hops) on HTTP redirects and handles client write half-close (`EOF`) with a 30 s relay timeout, and renders that touch blocked private addresses always raise `SSRF_BLOCKED`. System-Chrome renders also report HTTP redirect `final_url` values (and `sdk.aextract(..., render="auto")` forwards pre-resolved `final_url` values).
|
|
31
|
+
- PDF `/CreationDate` and `/ModDate` metadata are stored under `structured_facts` (`pdf_created_at`, `pdf_modified_at`) rather than reported as `temporal.published_at`, so file export dates are never mistaken for article publication dates.
|
|
32
|
+
- URL credential scrubbing also removes signed-URL parameters (AWS, Google Cloud, Azure SAS), OAuth client secrets and refresh/ID tokens, session ids, JWTs in paths, and Slack, Telegram and Discord webhook or bot tokens. A plain `session` parameter is no longer removed, because it often identifies the page.
|
|
33
|
+
|
|
34
|
+
- Tool arguments containing a lone UTF-16 surrogate return `BAD_INPUT` instead of an internal error.
|
|
35
|
+
|
|
36
|
+
### Packaging
|
|
37
|
+
|
|
38
|
+
- `mcp` moved from runtime dependencies to the `dev` extra; the server implements MCP stdio itself and only tests use the SDK.
|
|
39
|
+
- The Yahoo! JAPAN parser fixture now uses placeholder text and URLs instead of a captured results page.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- The verify-only MCP profile starts with a five-second budget and reads the supplied URLs. Callers can opt into hub expansion.
|
|
44
|
+
- `prism-search setup` installs the skill only for clients named with `--client`. `--client detected` selects every client whose folder exists. Without `--client`, setup lists detected clients and writes nothing.
|
|
45
|
+
- `PRISM_DISABLED_SOURCES` turns off built-in sources by name (`prism-search doctor` reports them as `disabled`). The READMEs state which search pages disallow automated access in robots.txt and that system proxy settings are not used.
|
|
46
|
+
- The bundled skill uses `prism-search verify` in examples and warns that the separate `prism-verify` package on PyPI is a different project.
|
|
47
|
+
|
|
48
|
+
- Date ranges or deadlines directly after registration/application labels (접수·모집·신청 기간, 募集期間, registration, applications, call for proposals, etc.) take precedence over unrelated sidebar ranges.
|
|
49
|
+
- Versioned searches route to the Region Pack `versioned` pool (registries, GitHub, regional web, Hacker News, Stack Exchange) rather than academic databases, and site home pages rank below detail pages in live-window searches.
|
|
50
|
+
- Loose closure words (`closed`, `ended`, 마감, 조기마감) show as `closure_hints` (`page also says: …`) when a future end date is present; only explicit closure phrases expire those pages.
|
|
51
|
+
- Hints for JavaScript-only pages and login walls stay browser-agnostic and tell the agent to use any connected browser tool when the answer depends on the page.
|
|
52
|
+
- READMEs in English, Korean, Japanese and Simplified Chinese position both workflows (agent booster `prism-verify` + keyless search `prism-search`), copy-paste MCP setup, Python examples, measured results and known limits.
|
|
53
|
+
- `server.json` and package version set to `0.2.0` (with `CHANGELOG.md` included in `sdist`).
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
- Use the exact PyPI release record for pinned URLs. Keep other unreadable release-specific links flagged for review when only project-wide API metadata is available. Use the matching crates.io version record for its release date. Omit the GitHub license field when GitHub supplies no license identifier.
|
|
58
|
+
- Keep dates explicitly labelled as venue closures out of opening-window calculations. Keep the original closure wording as a hint.
|
|
59
|
+
- Omit unparseable URLs from failure details and strip known credential parameters from URL fragments.
|
|
60
|
+
|
|
61
|
+
- Release dates and bare date mentions no longer expire a source. Weak closure words stay visible as hints. An explicit package ecosystem prefix scopes version lookups.
|
|
62
|
+
|
|
63
|
+
- Keep API-only summaries separate from fetched pages, retain browser and failure records, and preserve JSON-LD dates when serving documents from cache.
|
|
64
|
+
|
|
65
|
+
- Preserved `include_domains` in `expand_frontier(..., relax_constraints=...)`, flattened `inspect --view coverage` rejected/filtered rows, fixed `inspect --view document` URL rendering and pagination validation, and matched `similar --max-results` help text to its default (`5`).
|
|
66
|
+
- Prevented chunk boundary text gaps and mid-word/parenthesis splits in `chunk_text`, guarded short pages (`<= 200` chars) against over-aggressive UI chrome removal while stripping universal modal/popup/language-switch chrome, truncated excess links above `_MAX_LINKS` instead of failing, and caught giant `<script>` footer shells as `JS_REQUIRED`.
|
|
67
|
+
- Closed staged temp files before `os.link`/`os.replace` on Windows in `setup --force`, forced UTF-8 stdio output in CLI/MCP, eliminated immediate MCP `request_id` reuse races, guarded malformed URLs in `_detect_enrich_target`, and preserved resolved `final_url` across redirect failures and `verify_api` promotions.
|
|
68
|
+
- Fixed NAT64/DNS64 IPv6-embedded IPv4 checks, binary MIME/archive skips, post-chrome 2-hop link extraction, GitHub `tree`/`blob`/`pull`/`commit` noise filtering, and `find_similar` malformed-date exception handling.
|
|
69
|
+
|
|
70
|
+
### Measured
|
|
71
|
+
|
|
72
|
+
- Cross-domain verification suite (`benchmarks/verify_eval.py --offline`, 100 cases across 20 verticals): `0` crashes, `0` nav/footer chrome leaks, `100.0%` 2-hop precision (`99/99` on-topic, `0` off-topic leaks), `100.0%` `schema.org` JSON-LD recall (`100/100`), `0` expired leaks (`--must-be-active`), and `100.0%` empty-SPA detection (`100/100`).
|
|
73
|
+
- Live pricing probe (4 Dec 2026): four input URLs returned 11 pages (seven via hub links) and rendered 3,759 KB of HTML as a 4.5 KB table. The run recorded the redirect from Codeium to Devin.
|
|
74
|
+
- 40-case multilingual search benchmark, 4 December 2026 (UTC), `0` case errors, both runs replay identically:
|
|
75
|
+
|
|
76
|
+
| Scorer | Cases with results | Active-Yield@8 | Expired results returned | Term Recall@5 |
|
|
77
|
+
|---|---|---|---|---|
|
|
78
|
+
| Lexical (default) | 30 → 34 | 11/72 → 22/72 | 0/22 | 10/16 → 10/16 |
|
|
79
|
+
| Neural (optional) | 29 → 34 | 15/72 → 21/72 | 0/21 | 9/16 → 9/16 |
|
|
80
|
+
|
|
81
|
+
### Known issues
|
|
82
|
+
|
|
83
|
+
- With the optional neural scorer, `--fast` searches can run 2–4 s past the 5 s budget.
|
|
84
|
+
|
|
85
|
+
## [0.1.0] — 2026-12-04 (not published)
|
|
86
|
+
|
|
87
|
+
Internal baseline. Not released to PyPI or the MCP Registry.
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
|
|
91
|
+
- Core kernel: region packs for `kr`, `jp`, `us`, `eu` and `global`; region-aware date and deadline parsing; SSRF-guarded fetching (DNS check, 5 redirects, 2 MiB cap); login, captcha and JavaScript-shell detection; SQLite frontier and evidence store with full-text search and a 256 MB cache cap.
|
|
92
|
+
- 14 keyless sources: Naver web and blog, Yahoo! JAPAN, Bing web and news RSS, Google News RSS, DuckDuckGo (reserve), Wikipedia, Wikidata, Hacker News, Stack Exchange, GitHub, OpenAlex and arXiv; optional SearXNG.
|
|
93
|
+
- Four MCP tools over stdio: `search_frontier`, `expand_frontier`, `find_similar`, `inspect_evidence`.
|
|
94
|
+
- CLI with `search`, `expand`, `similar`, `inspect`, `serve`, `setup`, `doctor` and `clear-cache`; `--format text` output.
|
|
95
|
+
- Lexical scoring with no model, and optional multilingual ONNX scoring (`intfloat/multilingual-e5-small`) that warms in the background.
|
|
96
|
+
- Progressive widening strategies: `widen_adjacent`, `mine_hubs`, `bridge_language`, `deepen_terms`.
|
|
97
|
+
- Bundled agent skill and installer for Claude Code, Cursor, Codex, Antigravity, Gemini CLI, Windsurf and Hermes.
|
|
98
|
+
- 40-case multilingual benchmark with live collection and offline replay.
|
|
99
|
+
- CI with `ruff` and `pytest`, PEP 639 packaging and an MCP Registry `server.json`.
|
|
100
|
+
|
|
101
|
+
[0.2.0]: https://github.com/tenderloinsteak/prism-search/releases/tag/v0.2.0
|
|
102
|
+
[0.1.0]: https://github.com/tenderloinsteak/prism-search/commits/main
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contributing to Prism Search
|
|
2
|
+
|
|
3
|
+
A reproducible URL, query or parser fixture is a useful contribution. Open an issue when a provider stops returning results, Prism misses a date, or the evidence differs from the page.
|
|
4
|
+
|
|
5
|
+
## Run the checks
|
|
6
|
+
|
|
7
|
+
Install Python 3.11+ and [uv](https://docs.astral.sh/uv/). From the repository:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
uv sync --locked --extra dev
|
|
11
|
+
uv run ruff format --check .
|
|
12
|
+
uv run ruff check .
|
|
13
|
+
uv run pytest -W error
|
|
14
|
+
uv run python benchmarks/verify_eval.py --offline
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Tests use local fixtures or mocked HTTP, so the baseline runs without API credentials, a browser, Docker or an ONNX model. Use the smallest public or synthetic fixture that captures the behavior. Remove credentials, private URLs and account identifiers.
|
|
18
|
+
|
|
19
|
+
## Add or adjust a Region Pack
|
|
20
|
+
|
|
21
|
+
1. Start from [an existing pack](src/prism_search/regions/global.yaml) in `src/prism_search/regions/`.
|
|
22
|
+
2. Set the region's timezone, languages, date order and provider priorities. Keep site-specific URL rewrites in the pack when applicable.
|
|
23
|
+
3. Add an offline test for changed routing or URL rewrites. In the PR, include one representative query and describe what changed.
|
|
24
|
+
|
|
25
|
+
For a new provider, include a public endpoint reference, an offline sample response and any observed rate limits. The default configuration must work without API keys or paid services.
|
|
26
|
+
|
|
27
|
+
## Open a pull request
|
|
28
|
+
|
|
29
|
+
Use the PR template to describe the behavior, reproduction and verification. For user-visible CLI or MCP changes, update the corresponding examples.
|
|
30
|
+
|
|
31
|
+
Please report potential security issues privately through GitHub's **Security** tab when private reporting is enabled. A public issue can omit security-sensitive reproduction details.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Prism Search Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: prism-search
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Verify up to 50 URLs into a compact fact table, or give local agents free keyless web search.
|
|
5
|
+
Project-URL: Homepage, https://github.com/tenderloinsteak/prism-search
|
|
6
|
+
Project-URL: Repository, https://github.com/tenderloinsteak/prism-search
|
|
7
|
+
Project-URL: Issues, https://github.com/tenderloinsteak/prism-search/issues
|
|
8
|
+
Author: Prism Search Contributors
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai-agent,fastembed,mcp,onnx,search,semantic-search,web-search
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: beautifulsoup4>=4.12.0
|
|
20
|
+
Requires-Dist: courlan>=1.3
|
|
21
|
+
Requires-Dist: httpx[http2]>=0.27.0
|
|
22
|
+
Requires-Dist: jsonschema>=4.20
|
|
23
|
+
Requires-Dist: lxml>=5.3.0
|
|
24
|
+
Requires-Dist: numpy>=1.26.0
|
|
25
|
+
Requires-Dist: pydantic>=2.9.0
|
|
26
|
+
Requires-Dist: pypdf>=7.0.0
|
|
27
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
28
|
+
Requires-Dist: trafilatura>=2.0.0
|
|
29
|
+
Provides-Extra: browser
|
|
30
|
+
Requires-Dist: playwright>=1.49.0; extra == 'browser'
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: mcp>=1.9.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest>=8.3.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: ruff>=0.8.0; extra == 'dev'
|
|
36
|
+
Provides-Extra: neural
|
|
37
|
+
Requires-Dist: fastembed>=0.6.0; extra == 'neural'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# Prism Search
|
|
41
|
+
|
|
42
|
+
Prism Search verifies up to 50 URLs in parallel and compresses megabytes of HTML into a compact fact table (excerpts, dates, redirects, and GitHub/PyPI/npm/crates.io metadata), and provides free zero-API-key web search for local agents. Run it via CLI, MCP or Python with no API key, signup, Docker or model download.
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
# Get source evidence for links you already have.
|
|
46
|
+
uvx prism-search verify https://pypi.org/project/httpx/ --no-expand-hubs --fast --format table
|
|
47
|
+
|
|
48
|
+
# Search directly when your agent has no web tool.
|
|
49
|
+
uvx prism-search "Python httpx latest release and license" --temporality versioned --fast
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The verifier accepts up to 50 input URLs (HTML pages and public PDFs), emits compact fact tables or structured Markdown (`--format markdown`, `inspect --view markdown`), can follow relevant links from hub pages, optionally renders JS-only SPAs with local Chrome or `prism-search[browser]` (`--render auto`), and adds metadata from public GitHub repositories and package registries when available. It keeps excerpts and fetch outcomes in local SQLite so you can inspect them by handle. Pass `--ephemeral` for in-memory evidence.
|
|
53
|
+
|
|
54
|
+
Prism Search also discovers results with 17 built-in providers that need no API keys. A Region Pack selects a subset for each search. Install the optional `neural` extra to use multilingual ONNX ranking.
|
|
55
|
+
|
|
56
|
+
## MCP and Python
|
|
57
|
+
|
|
58
|
+
For MCP, set the command to `uvx` and the arguments to `["prism-search", "serve"]`. Add `"--mode", "verify"` for a two-tool profile for agents that already search. It starts with a five-second budget and reads the input URLs.
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from prism_search import verify
|
|
62
|
+
|
|
63
|
+
result = verify(["https://github.com/encode/httpx", "https://pypi.org/project/httpx/"])
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The package also installs a `prism-verify` command, the same as `prism-search verify`. To run it with uvx, use `uvx --from prism-search prism-verify`; the separate `prism-verify` package on PyPI is a different project.
|
|
67
|
+
|
|
68
|
+
Python 3.11+. MIT license. The README, terminal demo, benchmark protocol and client setup are at https://github.com/tenderloinsteak/prism-search.
|
|
69
|
+
|
|
70
|
+
<!-- mcp-name: io.github.tenderloinsteak/prism-search -->
|