Research + design: StarLang-defined scraping domain actor and researcher integration #171
Labels
No labels
bug
design
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-auto-research#171
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Operator decision
This scope is pre-approved to advance from research directly into design once the required research is complete and internally consistent. Do not stop for another approval gate between research and design unless the work would materially expand beyond this issue or discovers a real security/architecture blocker.
Research everything named below. Do not reduce this to “port Scrapy.” The goal is to determine the StarLang/runtime semantics needed so StarIntel can define reusable scrapers and expose them through a first-class actor/domain-server contract.
Goal
Research and design a StarIntel scraping capability, implemented StarLang-first, that lets StarLang define scrapers for:
The scraping actor/domain server must support request/reply to either a local or remote caller through the same typed contract. Locality is deployment/runtime topology, not a different API.
The resulting design should be reusable by StarIntel expert systems, agents, Auto-Research, agentic researcher actors, OSINT domain servers, and ordinary StarIntel actors without each subsystem inventing its own HTTP/browser stack.
Architecture direction
Treat this as a coherent Scraping / Source Acquisition Domain Server or equivalent domain boundary after research validates the exact name/ownership.
Do not create one actor per website or one actor per upstream scraping framework.
Expected shape:
Provider-specific/browser-specific implementation details stay behind capability adapters.
1. Deeply research Scrapy
Research current Scrapy architecture and enumerate the reusable semantics StarIntel actually needs, including at minimum:
Do not cargo-cult Twisted, Python classes, or Scrapy internals into StarLang. Extract the semantic contract.
2. Research what StarLang must support to DEFINE scrapers
Compare the requirements against the current
lost-rob0t/star-langcompiler/runtime. For every item classify exactly one:Research at least these language/runtime semantics:
Fetch / protocol
HTML extraction
JavaScript pages
Research the browser-backed capability needed for:
Determine whether the correct implementation is a Common Lisp browser adapter, a Chrome/Playwright process adapter, another browser protocol adapter, or a combination. StarLang remains the scraper definition/control language.
APIs
Support reusable definitions for:
RSS / Atom
Research first-class feed support or a small library pattern for:
Scraper composition
Research a StarLang scraper-definition model for:
Do not invent a second general-purpose programming language inside StarLang. Prefer a small declarative surface plus ordinary StarLang expressions/actors where needed.
3. Local + remote actor request/reply contract
Research and design one caller contract that works identically when the scraping actor/domain server is local or remote.
Required semantics:
success | partial | blocked | unavailable | cancelled | failed-style outcomes based on current StarLang conventionsCross-check existing approved StarLang research and current runtime rather than re-designing remoting from scratch.
4. CAPTCHA / challenge integration
Integrate research with #168.
A browser/HTTP scraper that encounters a challenge should be able to surface a typed challenge observation and optionally invoke
captcha.solvethrough the capability/domain-server registry when policy permits.Do not hard-code CAPTCHA providers or private solver knowledge into scraper definitions.
Preserve continuation state so the scrape can resume after challenge handling.
5. YaCy + SearX/SearXNG downstream examples
Use YaCy and SearX/SearXNG as example consumers/definitions, not the architectural boundary.
Research representative StarLang scraper/adapter definitions for:
YaCy
SearX / SearXNG
These examples should prove the same scraper primitives can express a real API/metasearch integration without writing a bespoke runtime actor for each service.
Coordinate conceptually with the StarIntel Search/provider work, but keep the scraping domain generic.
6. Research the StarIntel expert-system architecture
Research the current StarIntel expert-system direction and implementation, including the approved StarLang expert-system research referenced by #156.
Cover:
Do not revive a Prolog-only StarIntel actor architecture. StarLang owns the expert-engine boundary; Prolog may be a backend.
7. Research StarIntel agents + agentic researcher actors
Research the current StarIntel actor/agent model and Auto-Research agentic-research architecture, including #45 and current implementation/research state.
Enumerate:
Target architecture:
Do not let every agent ship its own fetch/browser/scraping implementation.
8. Security / resource model
Research and carry into design:
9. Required research outputs
Create/refresh research nodes covering at minimum:
Update
roam/internal/OSINT-TOOLS-LEDGER.orgwith Scrapy and any directly relevant browser/scraping technologies discovered during the pass.Cross-reference #165, #168, #156, and #45 where applicable.
10. Direct-to-design gate
Once the research above is complete:
The design must show at least one end-to-end example for each:
Completion criteria
ARDR bounded research pass — scraper semantics / StarLang gap checkpoint
Selected as the initial concrete candidate from #170. This pass does not approve implementation.
Current-source verification
Current
lost-rob0t/star-langprototype/domain-server-core-prototype.lispalready provides a useful lower layer: compileddomain-serverdeclarations with owned document types, accepted typed messages, declared tools, restart/mailbox/dispatcher/capabilities; typed domain tools with positivetimeout-ms; a process-tool runner using TERM + kill-after; keyed domain-server instances; and typed handler dispatch. This is enough to avoid inventing a second actor framework for scraping.The current domain-tool surface is intentionally much narrower than a scraper definition language: executable + argv template + input scalar + produced message + timeout + capabilities. It does not itself express HTTP request templates, response/content dispatch, DOM selectors, pagination, browser interactions, typed item emission, credential/session refs, crawl visited sets, or extraction pipelines. Those are real design gaps/patterns to classify rather than reasons to bypass StarLang.
Existing approved expert-system research (
STAR-LANG-RESEARCH-023) reinforces an important boundary: expert rules describe knowledge and checked conclusions; arbitrary HTTP/process/actor effects are excluded from rule RHS. Therefore experts should request collection through the scraping/domain capability and reason over returned typed evidence, not embed scraper side effects inside inference rules.Upstream evidence checkpoint
Scrapy 2.18's current docs separate semantics cleanly into scheduler/request queue, downloader middleware (HTTP-layer request/response behavior), spider middleware (response in / request+item out), item pipelines (validation/cleanup/dedup/storage), extensions/signals, and feed export. Its JOBDIR persistence persists scheduled requests, duplicate-filter state, and spider state so a crawl can resume. These are semantic responsibilities worth mapping; Twisted/Python classes are not.
SearXNG's current Search API is a strong downstream proof case:
/and/searchsupport GET/POST,format=json|csv|rssis instance-configurable, and queries exposeq, categories, language,pageno, time range, safe search, etc. A disabled machine-readable format can produce 403, so the StarLang adapter must represent instance capability/configuration and typed unavailable/unsupported outcomes rather than assume JSON everywhere. SearXNG also has explicit engine suspension/backoff policy for access denied, CAPTCHA and 429 conditions, which supports the existing StarIntel direction of typed challenge/rate outcomes + provider health rather than blind retry.YaCy remains a valid downstream instance boundary: current project docs describe local, organization portal, intranet, and P2P search modes, with JSON among its implementation technologies. A later pass still needs primary endpoint/schema verification before freezing the YaCy example contract.
StarLang classification from this pass
Already supported / reuse: domain-server ownership/accepted-message model; capability declaration; keyed actor/domain state; bounded process-tool timeout; runtime handler dispatch.
Library/pattern candidate (no syntax decision yet): typed scrape request/result messages; content-type dispatch; normalization pipelines; SearXNG query/result mapping; RSS/Atom mapping if ordinary typed iteration/composition is sufficient.
Likely StarLang surface/runtime extension requiring design: declarative request templates; selector/extraction expressions; bounded pagination/iteration + visited-set semantics; typed incremental item emission + terminal summary; opaque credential/session/artifact refs; provenance inheritance through fetch→extract→emit; optional capability/challenge continuation; scraper version identity/fixture binding.
Lower adapter primitive: HTTP client/DOM parser and browser protocol implementation should sit beneath StarLang rather than become language-specific provider actors.
External process only where justified: browser automation is the strongest candidate (Chromium/Playwright-style process/protocol boundary). StarLang must still own scraper definition/control semantics.
Design direction now sufficiently supported
Do not model
ScrapyActor,SearXActor, etc. Model one Source Acquisition / Scraping Domain Server contract, with StarLang-defined source-specific scraper definitions and adapter capabilities beneath it. Local and remote callers must use the same typed operation; transport/locality stays below the contract.Provisional flow:
researcher/actor -> typed acquire/scrape request -> domain server -> StarLang scraper definition -> HTTP|DOM|browser|feed adapter -> typed observations/items + provenance -> terminal outcomeExpert systems remain effect-closed: an expert can conclude that more evidence is needed / select a collection strategy, then the actor/researcher invokes the acquisition capability and returns evidence to inference.
Adversarial findings to carry into design
State
Research has materially advanced and the architecture direction is supported, but #169's full research scope is not complete yet (notably browser adapter primary-source pass, RSS/Atom semantics, YaCy endpoint/schema verification, full current StarLang remoting/cancellation/provenance cross-check, and agentic-researcher implementation inspection remain). Therefore this run does not mark the overall #169 research complete or DESIGN_READY_FOR_OPERATOR_REVIEW yet. No implementation issue was created and no implementation approval was inferred.
ARDR bounded research completion — READY_FOR_DESIGN → design produced
This cycle completes the remaining research gaps identified in the previous checkpoint and advances the scoped work to design under the operator's existing research→design authorization. This does not approve implementation.
Design produced: #171 —
DESIGN_READY_FOR_OPERATOR_REVIEW.First bounded implementation proposal produced:
lost-rob0t/star-lang#50, explicitlyAWAITING_OPERATOR_IMPLEMENTATION_APPROVAL.Current StarLang remoting / cancellation / durability verification
Current
starlang-runtime/src/wire-dispatcher.lispproves the lifecycle substrate needed by acquisition:star.cancelled;star.deadline-exceeded;Current
prototype/bbp-domain-remoting-tests.lispproves the same domain lifecycle can execute through a remote node: main gateway accepts the command, remote execution returns reply+completion, pending state clears, duplicate delivery replays terminal outcomes without re-running the tool, and remote nodes heartbeat/register through a remoting port. Therefore acquisition locality is a routing/runtime concern, not a second source API.Current
star-journal/src/journal.lispalready defines runtime journal eventspending,route-result, andremote-result, validates lifecycle command envelopes, and restricts settled dispatch outcomes to complete/retry/fail. Persisted scraper/crawl state should extend/reuse this ownership rather than invent a second scheduler journal.Browser / JavaScript primary-source findings
Current Playwright documentation confirms the adapter behaviors needed beneath StarLang:
BrowserContextprovides isolated cookie/local/session-storage environments and cheap independent contexts;Design consequence: browser execution belongs behind a bounded browser capability adapter with principal-scoped opaque context/session refs. StarLang owns navigation/extraction intent; native Playwright objects never enter StarLang IR.
Primary references retrieved 2026-08-29:
RSS / Atom semantics
RSS 2.0 is XML with channel metadata and item records; item
guid, links, publication date, enclosure and namespaced extensions are useful but not all feeds provide one universally perfect identity key. The adapter therefore needs deterministic fallback identity with provenance when a stable GUID is absent.Atom RFC 4287 gives a stronger identity/update contract:
atom:id;atom:updated;publishedand must represent update time independently;atom:ididentify the same entry, with latestupdatedbeing a normal processor choice;self/alternate.Design consequence: feed handling is likely a typed adapter/library pattern over HTTP + XML + bounded iteration, not necessarily new dedicated syntax. Preserve
publishedvsupdated, original feed identity, item/entry identity, extension namespaces and capture provenance.Primary references retrieved 2026-08-29:
YaCy verification
The current YaCy search-server repository (updated July 2026) states that its APIs are HTTP/XML and HTTP/JSON and that customized web applications can attach through those interfaces. The documented search interface exposes
yacysearch.json; older but project-owned API documentation gives the concrete/yacysearch.json?query=...&resource=...pattern. Current related YaCy projects continue to use/yacysearch.jsonas a compatibility path.Important negative finding: deep record offsets have historically had practical limits. Therefore the StarLang YaCy source definition must capability-test/bound pagination rather than assume arbitrary
startRecorddepth.Primary/current references retrieved 2026-08-29:
Agentic researcher boundary verified
Current canonical Auto-Research
STAR-RESEARCH-002 Deep Research Execution Adapter Analysisalready defines:Design consequence: Source Acquisition sits beneath researcher adapters as the reusable collection mechanism. It does not replace ADARD/ARDR supervision or become a second research control plane.
Expert-system boundary retained
Existing StarLang expert research requires declarative/effect-closed rule actions: HTTP, process launch and arbitrary actor sends are disallowed inside rule RHS. An expert may derive
evidence-neededor select a collection strategy; the owning actor/researcher invokes Source Acquisition and feeds returned typed evidence back into the expert session.partial/blockedacquisition must never collapse into logical absence/not-found.Final research classification
Already supported: domain-server ownership, typed lifecycle envelopes, correlation, deadline, cancellation, idempotent terminal replay, deferred completion, remote round-trip, bounded mailboxes, runtime journaling.
StarLang extension: scraper/source declaration + closed acquisition IR; deterministic version/fixture identity; bounded page/offset/cursor traversal + visited set; incremental bounded item emission; provenance inheritance; opaque scoped refs; optional challenge/capability continuation where not provided by shared work.
Common Lisp adapter beneath StarLang: HTTP transport, DOM/XML parsing, feed normalization and provider-independent request execution.
Isolated external process justified: browser automation, with Chromium/Playwright-style adapter as the strongest current candidate; StarLang remains definition/control authority.
Adversarial closeout
The research rejects:
No unresolved finding now requires changing the proposed Source Acquisition / Scraping Domain Server boundary.
State
READY_FOR_DESIGN(completed for #169 scope)DESIGN_READY_FOR_OPERATOR_REVIEWlost-rob0t/star-lang#50No product code was implemented and nothing was marked approved for implementation.