DESIGN_READY_FOR_OPERATOR_REVIEW: StarLang Source Acquisition / Scraping Domain Server #169
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#169
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?
Authority / state
READY_FOR_DESIGNDESIGN_READY_FOR_OPERATOR_REVIEWThis design does not authorize implementation and must not enter the executable RAGE queue until the operator explicitly approves an implementation slice.
StarIntel problem solved
StarIntel currently has domain-server/remoting/runtime primitives but no coherent StarLang-owned source-acquisition definition surface. Without one, OSINT actors, expert systems, Auto-Research workers, search providers, and future data-source plugins risk duplicating HTTP/browser/feed/scraping stacks and diverging on provenance, cancellation, resource limits, and local-vs-remote semantics.
Owning boundaries
lost-rob0t/star-lang: scraper/source definition language, typed IR, lifecycle semantics, capability references, provenance propagation, bounded iteration primitives.lost-rob0t/starintel-server: Source Acquisition Domain Server runtime integration and Common Lisp HTTP/DOM/feed adapters.lost-rob0t/starintel-auto-research: researcher integration and canonical research/design authority.Existing runtime reused
Current StarLang already provides:
pending,route-result, andremote-result.Therefore local and remote acquisition use one operation contract. No second remote scraper API is designed.
Domain contract
Canonical domain:
SourceAcquisitionDomainServer(final spelling may follow StarLang naming conventions).Conceptual request:
Conceptual outputs:
Large bodies, screenshots, browser state, credentials and retained captures travel by opaque scoped refs, never raw secrets/session material in scraper source or normal lifecycle envelopes.
StarLang scraper definition surface
Add a small declarative source-definition layer, not a second programming language.
A scraper definition owns:
Conceptual shape only:
The final grammar must lower into closed typed IR; scraper source may not name arbitrary host functions, shell commands, native Playwright objects, or raw credentials.
Required StarLang extensions
Slice A — scraper definition + typed acquisition IR
Needed in StarLang:
scraper/source declaration kind;http,dom,browser,feed) without embedding implementation objects;Slice B — bounded iteration / traversal
Needed in StarLang/runtime:
Slice C — opaque references + optional capability continuation
Needed in StarLang/runtime if not already generalized elsewhere:
credentialRef,sessionRef,artifactRef,resultRefvalues;blockedByChallenge/unsupportedChallenge/partialcontinuation compatible with #168;Slice D — incremental item emission
Current command handlers mainly model terminal reply/ack. Acquisition needs bounded intermediate item observations while preserving one final terminal outcome. Add a typed lifecycle projection for incremental emitted items or define the existing actor-message mechanism as the canonical stream path. Do not create an unbounded side channel.
Lower adapter contracts
HTTP adapter
Common Lisp implementation beneath StarLang should expose typed operations for:
DOM adapter
Typed parse/query boundary supporting:
Feed adapter
Feed support can remain a library/adapter pattern rather than new syntax if typed iteration is sufficient.
Normalize:
guidwhen valid/stable; otherwise use deterministic source-specific fallback from link + publication/content hash with provenance showing the fallback;atom:idas stable identity;publishedandupdatedseparately;Browser adapter
Use an isolated browser capability beneath StarLang. A Chromium/Playwright process/service adapter is justified because current Playwright provides isolated BrowserContexts, navigation/action auto-waiting, page/frame interaction, cookie/session handling and context-level network routing/interception.
Required StarIntel boundary:
Downstream proof definitions
Static HTML
HTTP GET -> bounded body -> DOM parse -> CSS/XPath extraction -> normalized typed items -> provenance -> terminal summary.
JavaScript-rendered page
Acquire browser capability -> create scoped context -> navigate -> wait for declared condition -> interaction steps -> extract rendered DOM -> emit typed items -> close/fence context -> terminal summary.
Paginated JSON API
HTTP request template -> JSON parse -> emit results -> obtain page/cursor token -> bounded paginate -> partial on exhausted budget or malformed cursor.
RSS / Atom
Conditional GET -> parse feed -> normalize stable item/entry identity + timestamps + links/enclosures -> dedup against prior observation identity -> emit new/changed entries -> terminal summary.
SearX/SearXNG
Use
/searchor/with configured machine-readable format, query/category/language/page parameters. Treat JSON/RSS support as instance capability because formats may be disabled. A 403/unsupported format becomes typedunsupported/unavailable, not an HTML parsing guess. Preserve instance and engine/provider provenance when present.YaCy
Use the instance HTTP/JSON search boundary such as
yacysearch.jsonwith query parameters. Treat endpoint/version/capability as instance configuration and preserve YaCy instance + underlying result URL provenance. Pagination/record offsets are bounded and capability-tested; do not assume arbitrarily deep offsets are supported.Expert-system integration
Expert rules remain effect-free. The expert may conclude
evidence-needed(...)or select a source strategy; the owning actor/researcher turns that conclusion into an acquisition command. Returned typed observations are projected back into expert facts with stable source object/provenance identity. Partial/blocked acquisition is evidence state, not silently equivalent to absence/not-found.Agentic researcher integration
Current Auto-Research deep-research architecture already treats external research engines/browser workers as bounded adapters under the Research Run Supervisor and Branch Supervisor; adapters receive scoped inputs/budgets and return normalized source/evidence events. Source Acquisition becomes the reusable collection capability underneath those workers:
The acquisition domain never owns candidate promotion, research-plan authority, or canonical Org writes.
Security/resource invariants
Adversarial review
Rejected alternatives
Remaining design risks carried as implementation requirements
No unresolved issue above requires changing the architecture boundary.
Dependency-ordered proposed implementation slices
All remain AWAITING_OPERATOR_IMPLEMENTATION_APPROVAL.
starintel-serverSource Acquisition Domain Server integration using the same local/remote lifecycle contract.RED-first targets
Every coding slice requires a failing contract test before production mutation. The first slice's RED target is a StarLang fixture containing a valid
scraperdeclaration that must currently fail because the parser/compiler has no scraper declaration/typed acquisition IR. Invalid fixtures must prove arbitrary host calls/raw credentials/unbounded pagination are rejected by the closed grammar.Implementation approval
PENDING / AWAITING_OPERATOR_IMPLEMENTATION_APPROVALARDR has no authority to change this state.