Skip to content

Wire weighted path selection as a grounded sink - #101

Open
MesTTo wants to merge 4 commits into
trueagi-io:mainfrom
MesTTo:pr/mork-weighted-selection-tree
Open

Wire weighted path selection as a grounded sink#101
MesTTo wants to merge 4 commits into
trueagi-io:mainfrom
MesTTo:pr/mork-weighted-selection-tree

Conversation

@MesTTo

@MesTTo MesTTo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Exposes the weighted-path select_by_offset primitive as a grounded sink (wselect <offset> <item> <weight>) behind a default-off weighted_select feature, rather than leaving it an un-wired module. Each matched fact contributes (item, weight); weights accumulate into the signed index, and at finalize the item at cumulative-weight <offset> (deterministic inverse-CDF selection) is written back as a (wselected <item>) atom that ordinary queries read. Numbers are decimal symbols parsed the way SumSink parses its weights; modeled on the write-back sinks.

Feature-gated (default build unchanged, 0 regressions). Two end-to-end tests (cumulative-offset selection + out-of-range guard) and a runnable resources/weighted_select.mm2; the selection-partition soundness is modeled in Alloy (github.com/MesTTo/alloy-mork: fac24).

MesTTo added 4 commits July 4, 2026 07:13
Exposes the WeightedPathIndex select_by_offset primitive as a grounded sink
`(wselect <offset> <item> <weight>)`, behind a default-off `weighted_select`
feature, instead of leaving it as an un-wired island. Each matched fact
contributes (item, weight); weights accumulate into the signed index via
apply_delta, and at finalize the item at cumulative-weight <offset> (deterministic
inverse-CDF selection) is written back as a `(wselected <item>)` atom that ordinary
queries read. Numbers are decimal-digit symbols parsed as SumSink parses its
weights; modeled on the write-back sinks, nothing reimplemented. Feature-gated so
the default build is unchanged (0 regressions). Two end-to-end tests cover the
cumulative-offset selection and the out-of-range guard; runnable
resources/weighted_select.mm2. Soundness of the partition is modeled in Alloy
(fac24_weighted_select in MesTTo/alloy-mork).
@MesTTo
MesTTo force-pushed the pr/mork-weighted-selection-tree branch from d590652 to c86debc Compare July 3, 2026 21:16
@MesTTo MesTTo changed the title Add aggregate weighted path selection Wire weighted path selection as a grounded sink Jul 3, 2026
@MesTTo MesTTo mentioned this pull request Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant