Skip to contents

Finds trace entries whose node sets overlap with context$nodes and rewrites their polarity field. Only the most recent n_recent matching entries are updated (default: 3).

Usage

update_task_polarity(graph, context, polarity, n_recent = 3L)

Arguments

graph

An rrlm_graph / igraph object. Used to resolve the project root.

context

An rrlm_context object (output of query_context()). The $nodes field is used to match trace entries.

polarity

Numeric(1) in \([-1, 1]\). New polarity value to apply.

n_recent

Integer(1). Maximum number of recent matching entries to update. Default 3L.

Value

The graph, invisibly (no in-memory state change; the JSONL file is rewritten).

Examples

if (FALSE) { # \dontrun{
g   <- build_rrlm_graph("mypkg")
ctx <- query_context(g, "parse CSV files")
# User says context was helpful:
update_task_polarity(g, ctx, polarity = 0.8)
} # }