research

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LeakageAuditMarkdown

func LeakageAuditMarkdown(rows []LeakageAuditRow) string

LeakageAuditMarkdown renders a paper-level leakage/evidence table and snippets.

func ParsedTextDocument

func ParsedTextDocument(paperID, title, text string, chunkSize int) parsing.ParsedDocument

ParsedTextDocument converts extracted paper text into RForge parsed-document JSON.

func ScreeningMarkdown

func ScreeningMarkdown(queue []ScreeningRecord, limit int) string

ScreeningMarkdown renders a deterministic top-N review queue.

func WriteScreeningCSV

func WriteScreeningCSV(w io.Writer, queue []ScreeningRecord) error

WriteScreeningCSV writes queue rows in a review-friendly tabular form.

Types

type BriefOptions added in v0.2.0

type BriefOptions struct{ SearchDir, Out string }

type BriefResult added in v0.2.0

type BriefResult struct {
	Topic        string   `json:"topic"`
	Queries      []string `json:"queries"`
	Sources      []string `json:"sources"`
	TotalRecords int      `json:"totalRecords"`
	Deduped      int      `json:"deduped"`
	Failures     int      `json:"failures"`
	BriefSize    int      `json:"briefSize"`
	Out          string   `json:"out"`
	Papers       []Paper  `json:"-"`
	Markdown     string   `json:"-"`
}

type BuildInfo added in v0.2.0

type BuildInfo struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	Date    string `json:"date"`
}

BuildInfo identifies the engine that produced an artifact.

type CompareOptions added in v0.2.0

type CompareOptions struct {
	Dirs, Labels []string
	Out          string
}

type CompareResult added in v0.2.0

type CompareResult struct {
	Labels   []string          `json:"labels"`
	Papers   []ComparisonPaper `json:"papers"`
	Total    int               `json:"total"`
	Markdown string            `json:"-"`
}

type ComparisonPaper added in v0.2.0

type ComparisonPaper struct {
	Title string   `json:"title"`
	ID    string   `json:"id"`
	In    []string `json:"in"`
}

type Error added in v0.2.0

type Error struct {
	Code     string
	ExitCode int
	Err      error
}

Error preserves the operation's machine-readable failure code for adapters.

func (*Error) Error added in v0.2.0

func (e *Error) Error() string

func (*Error) Unwrap added in v0.2.0

func (e *Error) Unwrap() error

type HistoryOptions added in v0.2.0

type HistoryOptions struct {
	ResearchDir, Term, Out string
	// Limit is required; zero returns no results, matching CLI --limit 0.
	Limit int
}

type HistoryRecord added in v0.2.0

type HistoryRecord struct {
	Topic   string `json:"topic"`
	Title   string `json:"title"`
	DOI     string `json:"doi,omitempty"`
	ArXivID string `json:"arxivId,omitempty"`
	Year    int    `json:"year"`
	Matches int    `json:"matches"`
}

HistoryRecord is one matching paper in a research topic.

type HistoryResult added in v0.2.0

type HistoryResult struct {
	Term    string          `json:"term"`
	Count   int             `json:"count"`
	Results []HistoryRecord `json:"results"`
}

type LeakageAuditRow

type LeakageAuditRow struct {
	PaperID             string          `json:"paperId"`
	Title               string          `json:"title"`
	Passages            int             `json:"passages"`
	ValidationEvidence  []string        `json:"validationEvidence"`
	FeatureEvidence     []string        `json:"featureEvidence"`
	HorizonDataEvidence []string        `json:"horizonDataEvidence"`
	LeakageRiskEvidence []string        `json:"leakageRiskEvidence"`
	LeakageFlags        map[string]bool `json:"leakageFlags"`
	TriageRisk          string          `json:"triageRisk"`
	RecommendedUse      string          `json:"recommendedUse"`
}

LeakageAuditRow captures keyword evidence for one parsed paper.

func BuildLeakageAudit

func BuildLeakageAudit(parsedDir string) ([]LeakageAuditRow, error)

BuildLeakageAudit extracts conservative keyword evidence from parsed documents.

func BuildLeakageAuditFromTextDir added in v0.1.9

func BuildLeakageAuditFromTextDir(textDir string, chunkSize int) ([]LeakageAuditRow, error)

BuildLeakageAuditFromTextDir extracts conservative keyword evidence from plain text files.

type LitOptions added in v0.2.0

type LitOptions struct{ ResearchDir, Out string }

type LitResult added in v0.2.0

type LitResult struct {
	SchemaVersion   string           `json:"schema_version"`
	Command         string           `json:"command"`
	ResearchDir     string           `json:"research_dir"`
	Topics          int              `json:"topics"`
	TotalPapers     int              `json:"total_papers"`
	UniqueDOIs      int              `json:"unique_dois"`
	KeywordThemes   int              `json:"keyword_themes"`
	CrossTopic      int              `json:"cross_topic"`
	Failures        int              `json:"failures"`
	NoAbstract      int              `json:"no_abstract"`
	HasScreening    bool             `json:"has_screening"`
	Timestamp       string           `json:"timestamp"`
	RunID           string           `json:"run_id"`
	ProvenanceLevel provenance.Level `json:"provenance_level"`
	Question        string           `json:"question"`
	Depth           string           `json:"depth"`
	Sources         []string         `json:"sources"`
	Errors          []string         `json:"errors"`
	Build           BuildInfo        `json:"rforge_version"`
	Markdown        string           `json:"-"`
}

LitResult is the synthesis summary and its engine provenance identity.

type Paper added in v0.2.0

type Paper struct {
	Title       string   `json:"title"`
	Year        int      `json:"year"`
	Venue       string   `json:"venue"`
	Abstract    string   `json:"abstract"`
	OpenAccess  bool     `json:"openAccess"`
	Source      string   `json:"source"`
	URLs        []string `json:"urls"`
	Identifiers struct {
		DOI     string `json:"DOI"`
		ArXivID string `json:"ArXivID"`
	} `json:"identifiers"`
}

Paper is a search-result record used by briefs and comparisons.

func ReadPaperResults added in v0.2.0

func ReadPaperResults(searchDir string) ([]Paper, error)

ReadPaperResults reads deduped paper results from a search dir.

type RankOptions added in v0.2.0

type RankOptions struct {
	Topic                   string
	Sources                 []string
	Limit                   int
	GraphPath, Out, Project string
}

type RankResult added in v0.2.0

type RankResult struct {
	Topic    string    `json:"topic"`
	Total    int       `json:"total"`
	Rankings []Ranking `json:"rankings"`
	Out      string    `json:"-"`
}

type Ranking added in v0.2.0

type Ranking struct {
	Rank  int     `json:"rank"`
	Title string  `json:"title"`
	Score float64 `json:"score"`
	// RawScore preserves the original precision for text rendering.
	RawScore   float64 `json:"-"`
	DOI        string  `json:"doi,omitempty"`
	ArXivID    string  `json:"arxivId,omitempty"`
	Year       int     `json:"year"`
	Venue      string  `json:"venue,omitempty"`
	OpenAccess bool    `json:"openAccess"`
	Source     string  `json:"source"`
}

type ScreeningRecord

type ScreeningRecord struct {
	Score             int      `json:"score"`
	Decision          string   `json:"decision"`
	MatchedGroups     []string `json:"matchedGroups"`
	NegativeTerms     []string `json:"negativeTerms"`
	Title             string   `json:"title"`
	Year              int      `json:"year,omitempty"`
	DOI               string   `json:"doi,omitempty"`
	ArXivID           string   `json:"arxivId,omitempty"`
	OpenAlexID        string   `json:"openAlexId,omitempty"`
	SemanticScholarID string   `json:"semanticScholarId,omitempty"`
	OpenAccess        bool     `json:"openAccess,omitempty"`
	Sources           []string `json:"sources"`
}

ScreeningRecord is one deterministic first-pass relevance decision.

func BuildScreeningQueue

func BuildScreeningQueue(libraryPath, searchResultsDir string) ([]ScreeningRecord, error)

BuildScreeningQueue scores library/search-result records for first-pass review.

type SearchConnector added in v0.2.0

type SearchConnector interface {
	Search(context.Context, sources.SourceQuery) (sources.SourceResponse, error)
}

SearchConnector is the source operation needed by ranking. Adapters supply configured connectors, keeping credentials and transport policy out of research.

type Service added in v0.2.0

type Service struct {
	Connector func(string) (SearchConnector, bool)
	Now       func() time.Time
	Build     BuildInfo
}

Service runs research operations independently of any command or transport. Connector is required for Rank; Now and Build may be omitted for local use.

func (Service) Brief added in v0.2.0

func (s Service) Brief(opts BriefOptions) (BriefResult, error)

Brief builds and optionally persists a compact summary of one search session.

func (Service) Compare added in v0.2.0

func (s Service) Compare(opts CompareOptions) (CompareResult, error)

Compare builds the identifier-indexed union and overlap of search sessions.

func (Service) History added in v0.2.0

func (s Service) History(opts HistoryOptions) (HistoryResult, error)

History searches persisted sessions, retaining topic identity and match counts.

func (Service) Lit added in v0.2.0

func (s Service) Lit(opts LitOptions) (LitResult, error)

Lit synthesizes topic sessions and transactionally persists LIT and its receipt.

func (Service) Rank added in v0.2.0

func (s Service) Rank(ctx context.Context, opts RankOptions) (RankResult, error)

Rank searches configured sources, scores papers and commits rankings with a receipt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL