forked from dmmulroy/just-prolog
-
Notifications
You must be signed in to change notification settings - Fork 0
Native Problog #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
subtleGradient
wants to merge
33
commits into
main
Choose a base branch
from
native-datalog
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
1882d14
problog++
subtleGradient 153df92
problog++
subtleGradient 005ef34
dotok reconcile refresh
subtleGradient 36119e8
dotok delegate high-slice pass
subtleGradient 84b2fd2
implement sampling backend path and nonground query expansion
subtleGradient fe3638d
dotok reconcile bun parity and examples gaps
subtleGradient 219b205
problog++
subtleGradient 0ee8a70
Add oxlint and lint scripts
subtleGradient e5801af
Update problog-semantics-and-inference.red.test.ts
subtleGradient c849c28
Handle missing query counts and probabilities
subtleGradient 5ea972a
tsgo
subtleGradient 2ec5514
cleanup
subtleGradient d95ff09
simplify problog api and support custom predicates
subtleGradient ff77b27
dotok reconcile parity and examples slices
subtleGradient 8206ca2
reconcile ++
subtleGradient f7ad189
start delegation on unblocked high-level slices
subtleGradient 50fd7fc
close high gates and unblock medium slices
subtleGradient 0a80475
complete medium gates and release low-level queue
subtleGradient c8de0cb
add offline stub fallback for user-blocked corpus decision
subtleGradient 30b95c6
serialize low-level queue to avoid file-scope overlap
subtleGradient 3c4a390
delegate first low-level batch across red green and worker phases
subtleGradient c4e209e
delegate second low-level green batch and close blockers
subtleGradient 86032fd
delegate validation, probability contract, and priority parity red spec
subtleGradient 97cd731
delegate fixture mapping green work and runner completeness checks
subtleGradient 0b79fc7
delegate root bun parity command wiring and docs
subtleGradient 5fa9235
delegate offline wiring, determinism proof, and evolution red checks
subtleGradient f959f55
delegate reconciliation reset and refreshed task graph
subtleGradient f4ec84d
delegate active slices and add parity anti-blocker stub task
subtleGradient e1d82f3
delegate evolution guardrails and refresh parity stub
subtleGradient 6dfacb9
delegate parity graph advance and invalid model audit
subtleGradient c4f1345
delegate explicit invalid-model errors and full parity registry
subtleGradient 3de4dca
delegate offline parity reporting and unblock drift enforcement
subtleGradient b9a3440
delegate parity drift enforcement
subtleGradient File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| node_modules/ | ||
| dist/ | ||
| coverage/ | ||
| .tmp/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # ProbLog Bun Test Parity Ideal Target State | ||
|
|
||
| This file captures the evergreen ideal state for Bun-based tests that demonstrate ProbLog behavior in `just-prolog` with parity against `.tmp/problog`. | ||
|
|
||
| ## Bun Test Execution Path | ||
|
|
||
| - `PBT-PATH-001`: The parity suite is invokable from repository root with `bun test` and no required `cd` into a subdirectory. | ||
| - `PBT-PATH-002`: The parity suite execution path is deterministic: the same checked-out commit and fixture corpus yield the same pass/fail result under `bun test`. | ||
| - `PBT-PATH-003`: Drift detection is fail-fast: any unmapped or extra fixture in the declared scope causes `bun test` to fail in the parity suite run. | ||
|
|
||
| ## Referenced Source Set | ||
|
|
||
| - `PBT-SOURCE-001`: The authoritative fixture corpus root is `.tmp/problog/test`. | ||
| - `PBT-SOURCE-002`: The current top-level fixture corpus contains exactly `107` `.pl` files directly under `.tmp/problog/test`. | ||
| - `PBT-SOURCE-003`: The current immediate subdirectories under `.tmp/problog/test` are exactly `bn`, `constraints`, `dtproblog`, `lfi`, `lficont`, `parser`, `sample`, `specific`, and `tasks`. | ||
| - `PBT-SOURCE-004`: The parity scope for this target state is top-level `.pl` fixtures only; fixtures located inside immediate subdirectories are out of scope. | ||
| - `PBT-SOURCE-005`: The referenced source set is treated as read-only input for parity validation. | ||
|
|
||
| ## Fixture Mapping Parity | ||
|
|
||
| - `PBT-MAP-001`: Mapping cardinality is bijective across the declared scope: `107` in-scope source fixtures map to `107` parity test cases. | ||
| - `PBT-MAP-002`: Each in-scope source fixture maps to exactly one Bun parity test case. | ||
| - `PBT-MAP-003`: Each Bun parity test case maps to exactly one in-scope source fixture. | ||
| - `PBT-MAP-004`: A fixture registry drift check fails the suite when any in-scope fixture is unmapped or when any mapped fixture path does not exist. | ||
| - `PBT-MAP-005`: Concrete fixtures `01_inconsistent.pl`, `ad_fact.pl`, `4_bayesian_net.pl`, and `non_ground_query.pl` are in-scope and each has exactly one mapped Bun parity test case. | ||
|
|
||
| ## Behavior Demonstration Parity | ||
|
|
||
| - `PBT-BEH-001`: Each mapped Bun test demonstrates the same behavioral claim as its corresponding source fixture. | ||
| - `PBT-BEH-002`: Numeric probabilistic expectations in mapped Bun tests match the corresponding source fixture expectations. | ||
| - `PBT-BEH-003`: Error-mode expectations in mapped Bun tests match the corresponding source fixture expectations. | ||
|
|
||
| ## Coverage Criterion | ||
|
|
||
| - `PBT-COV-001`: Fixture-level parity coverage across the declared scope is exactly `100%` (`107/107` mapped). | ||
| - `PBT-COV-002`: Any coverage value below `100%` for the declared scope fails the parity suite. | ||
| - `PBT-COV-003`: The parity suite reports failure when corpus drift changes the in-scope fixture set and mapping is not updated to restore `107/107` coverage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # ProbLog Examples Ideal Target State | ||
|
|
||
| This file captures the evergreen ideal state for a reusable set of ProbLog examples in `just-prolog`. | ||
|
|
||
| ## Scope and Curation | ||
|
|
||
| - `P2EX-SCOPE-001`: A dedicated examples set exists for ProbLog programs. | ||
| - `P2EX-SCOPE-002`: Each example has a stable identifier that is unique within the examples set. | ||
| - `P2EX-SCOPE-003`: Each example states its intent in one concise sentence. | ||
| - `P2EX-SCOPE-004`: Example coverage spans deterministic baseline, probabilistic facts, annotated disjunctions, and evidence-conditioned queries. | ||
|
|
||
| ## Example Structure | ||
|
|
||
| - `P2EX-STRUCT-001`: Each example includes a ProbLog source program. | ||
| - `P2EX-STRUCT-002`: Each example declares at least one `query/1` directive. | ||
| - `P2EX-STRUCT-003`: Examples that model observations include `evidence/1` or `evidence/2` directives. | ||
| - `P2EX-STRUCT-004`: Each example defines expected numeric probabilities for its query atoms. | ||
| - `P2EX-STRUCT-005`: Each example defines a numeric tolerance used for probability comparison. | ||
|
|
||
| ## Behavioral Guarantees | ||
|
|
||
| - `P2EX-BEH-001`: Running an example produces query marginals in the same order as the declared expected outcomes. | ||
| - `P2EX-BEH-002`: Every expected probability assertion evaluates to pass or fail without ambiguous states. | ||
| - `P2EX-BEH-003`: Invalid example definitions produce explicit validation errors. | ||
| - `P2EX-BEH-004`: Inconsistent evidence examples produce explicit inconsistent-evidence errors. | ||
|
|
||
| ## Portfolio Coverage | ||
|
|
||
| - `P2EX-PORT-001`: The examples set includes a two-coin model with a derived query. | ||
| - `P2EX-PORT-002`: The examples set includes at least one annotated-disjunction model. | ||
| - `P2EX-PORT-003`: The examples set includes at least one Bayesian-network style conditional model. | ||
| - `P2EX-PORT-004`: The examples set includes at least one model with contradictory evidence. | ||
| - `P2EX-PORT-005`: The examples set includes at least one model that demonstrates non-ground query usage. | ||
|
|
||
| ## Evolution Rules | ||
|
|
||
| - `P2EX-EVO-001`: New examples are additive and do not silently change existing example identifiers. | ||
| - `P2EX-EVO-002`: Changes to expected probabilities require an explicit rationale captured next to the example metadata. | ||
| - `P2EX-EVO-003`: The examples set remains runnable in automated test environments without network access. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # ProbLog2 Ideal Target State | ||
|
|
||
| This file captures the evergreen ideal state for ProbLog2 support in `just-prolog`. | ||
|
|
||
| ## Boundary and API | ||
|
|
||
| - `P2-API-001`: `just-prolog` exposes a dedicated probabilistic runtime API that is distinct from the deterministic `Prolog` runtime. | ||
| - `P2-API-002`: The existing deterministic `Prolog` API and behavior remain unchanged when ProbLog features are not used. | ||
| - `P2-API-003`: Probabilistic query results include numeric probabilities per requested query atom. | ||
| - `P2-API-004`: Probabilistic query results expose explicit error states for inconsistent evidence and invalid probabilistic models. | ||
|
|
||
| ## Language Surface | ||
|
|
||
| - `P2-LANG-001`: The ProbLog parser accepts probabilistic annotations with `::` for facts and clauses. | ||
| - `P2-LANG-002`: The ProbLog parser accepts annotated disjunction heads with `;` for both fact and rule forms. | ||
| - `P2-LANG-003`: The ProbLog parser accepts `query/1` directives. | ||
| - `P2-LANG-004`: The ProbLog parser accepts `evidence/1` and `evidence/2` directives. | ||
| - `P2-LANG-005`: The ProbLog parser accepts negation as failure with `\+` in ProbLog mode. | ||
| - `P2-LANG-006`: The ProbLog parser accepts both `:-` and `<-` as clause separators in ProbLog mode. | ||
|
|
||
| ## Probabilistic Semantics | ||
|
|
||
| - `P2-SEM-001`: Ground probabilistic facts represent independent binary random choices unless linked by an annotated disjunction group. | ||
| - `P2-SEM-002`: Annotated disjunction alternatives are mutually exclusive within a group. | ||
| - `P2-SEM-003`: Annotated disjunction semantics include an implicit null outcome with probability `1 - sum(head_probabilities)` when `sum(head_probabilities) < 1`. | ||
| - `P2-SEM-004`: Probabilistic clauses are lowered to an equivalent internal choice representation that preserves query marginals. | ||
| - `P2-SEM-005`: Probabilities are computed as conditional marginals `P(Query | Evidence)` when evidence is present. | ||
| - `P2-SEM-006`: Contradictory evidence produces an explicit inconsistent-evidence error. | ||
| - `P2-SEM-007`: Models that yield non-ground probabilistic choices after grounding produce an explicit non-ground-probabilistic-clause error. | ||
| - `P2-SEM-008`: Non-ground `query(...)` directives are supported when probabilistic parts are groundable. | ||
|
|
||
| ## Inference Backends | ||
|
|
||
| - `P2-INF-001`: An exact inference backend exists for finite grounded models. | ||
| - `P2-INF-002`: An approximate sampling backend exists for large models where exact inference is impractical. | ||
| - `P2-INF-003`: Backend selection is explicit and observable through runtime configuration. | ||
| - `P2-INF-004`: For finite benchmark models, exact and sampling backends agree within configured numeric tolerance. | ||
|
|
||
| ## Conformance Suite | ||
|
|
||
| - `P2-CONF-001`: The conformance suite includes a two-coin disjunction case equivalent to `.tmp/problog/test/sample/some_heads.pl` with expected probability `0.8` for `someHeads`. | ||
| - `P2-CONF-002`: The conformance suite includes evidence conditioning equivalent to `.tmp/problog/test/sample/some_heads_evidence.pl` with expected probability `0.6` for `someHeads` given `heads1=false`. | ||
| - `P2-CONF-003`: The conformance suite includes annotated-disjunction marginals equivalent to `.tmp/problog/test/ad_fact.pl`. | ||
| - `P2-CONF-004`: The conformance suite includes conditional Bayesian-network cases equivalent to `.tmp/problog/test/4_bayesian_net.pl` and `.tmp/problog/test/5_bayesian_net.pl`. | ||
| - `P2-CONF-005`: The conformance suite includes inconsistent evidence failure equivalent to `.tmp/problog/test/01_inconsistent.pl`. | ||
| - `P2-CONF-006`: The conformance suite includes non-ground probabilistic clause failure equivalent to `.tmp/problog/test/nonground.pl`. | ||
|
|
||
| ## Compatibility Guardrail | ||
|
|
||
| - `P2-COMP-001`: Existing deterministic test suites for `just-prolog` and `just-prolog-tool` remain green after ProbLog support is added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /Users/tom/Work/work/.opencode | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| probe |
15 changes: 15 additions & 0 deletions
15
...20260227-reconciliation-reset/task-h-problog-bun-parity-suite-20260227203012.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| id: task-h-problog-bun-parity-suite | ||
| level: high | ||
| status: pending | ||
| blocked_by: [] | ||
| expires_at: 2026-03-21T00:58:00Z | ||
| --- | ||
|
|
||
| ## Objective | ||
|
|
||
| Establish Bun parity suite guarantees for top-level ProbLog fixture mapping, deterministic root execution, and drift-fail behavior. | ||
|
|
||
| ## Done-when | ||
|
|
||
| `PBT-PATH-*`, `PBT-MAP-*`, `PBT-BEH-*`, `PBT-COV-*`, `PBT-SOURCE-004`, and `PBT-SOURCE-005` are demonstrably true in automated runs. |
14 changes: 14 additions & 0 deletions
14
.tasks/archive/20260227-reconciliation-reset/task-h-problog-bun-parity-suite.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| id: task-h-problog-bun-parity-suite | ||
| level: high | ||
| status: pending | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T23:17:17Z | ||
| --- | ||
|
|
||
| ## Objective | ||
| Establish a Bun parity suite for ProbLog fixtures that can be run from repository root. | ||
|
|
||
| ## Done-when | ||
| - Root `bun test` includes the intended ProbLog parity suite path. | ||
| - Parity execution path and drift checks are defined and enforceable. |
20 changes: 20 additions & 0 deletions
20
...7-reconciliation-reset/task-h-problog-compatibility-guardrail-20260227181708.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| id: task-h-problog-compatibility-guardrail | ||
| level: high | ||
| status: done | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T22:40:17Z | ||
| --- | ||
|
|
||
| ## Objective | ||
|
|
||
| Restore deterministic compatibility across root and tool validation suites. | ||
|
|
||
| ## Done-when | ||
|
|
||
| Root and tool regression paths pass with ProbLog support in place. | ||
|
|
||
| ## Green Phase Evidence | ||
|
|
||
| - `npm run tool:test:run` passes in `packages/just-prolog-tool` after prebuilding root package with `--noCheck` to satisfy package entry resolution during Vitest import analysis. | ||
| - `npm run test:run -- test/prolog.test.ts test/runtime-behavior.test.ts` passes in repository root. |
24 changes: 24 additions & 0 deletions
24
...archive/20260227-reconciliation-reset/task-h-problog-compatibility-guardrail.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| id: task-h-problog-compatibility-guardrail | ||
| level: high | ||
| status: in-progress | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T22:18:23Z | ||
| --- | ||
|
|
||
| ## Objective | ||
| Restore compatibility guardrails so deterministic root and tool suites can run green together. | ||
|
|
||
| ## Done-when | ||
| - Tool dependency/runtime issue is resolved. | ||
| - Mono regression validation can confirm `P2-COMP-001` readiness. | ||
|
|
||
| ## Green phase evidence | ||
| - `npm run tool:test:run` initially failed with `Cannot find package 'ai'` from `packages/just-prolog-tool/src/tool.ts`. | ||
| - Added runtime `ai` dependency wiring in `packages/just-prolog-tool/package.json` and refreshed lock/install state. | ||
| - Re-ran `npm run tool:test:run`; missing `ai` error no longer appears. | ||
| - Current blocker: tool suite now fails earlier on `just-prolog` package entry resolution (`Failed to resolve entry for package "just-prolog"`). | ||
| - `npm run test:run -- test/prolog.test.ts test/runtime-behavior.test.ts` passes (`2 passed`, `12 passed`). | ||
|
|
||
| ## Blockers | ||
| - Tool tests are still red due to `just-prolog` workspace entry resolution in Vite import analysis, outside the requested `ai` missing package fix. |
15 changes: 15 additions & 0 deletions
15
.../archive/20260227-reconciliation-reset/task-h-problog-conformance-and-compat.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| id: task-h-problog-conformance-and-compat | ||
| level: high | ||
| status: done | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T21:41:19Z | ||
| --- | ||
| Objective | ||
| - Establish ProbLog conformance coverage and deterministic compatibility guardrails for rollout safety. | ||
|
|
||
| Done-when | ||
| - Conformance/compat medium tasks are unblocked with fixture scope and regression criteria defined. | ||
|
|
||
| Completion evidence | ||
| - Red-phase delegation produced failing tests at `test/problog-conformance-and-compat.red.test.ts`. |
15 changes: 15 additions & 0 deletions
15
.tasks/archive/20260227-reconciliation-reset/task-h-problog-examples-automation.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| id: task-h-problog-examples-automation | ||
| level: high | ||
| status: pending | ||
| blocked_by: [] | ||
| expires_at: 2026-03-21T00:58:00Z | ||
| --- | ||
|
|
||
| ## Objective | ||
|
|
||
| Add durable automation and evolution guardrails for ProbLog examples to prevent silent contract drift. | ||
|
|
||
| ## Done-when | ||
|
|
||
| `P2EX-EVO-*` expectations are validated in repeatable offline automation. |
15 changes: 15 additions & 0 deletions
15
.tasks/archive/20260227-reconciliation-reset/task-h-problog-examples-contract.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| id: task-h-problog-examples-contract | ||
| level: high | ||
| status: pending | ||
| blocked_by: [] | ||
| expires_at: 2026-03-21T00:58:00Z | ||
| --- | ||
|
|
||
| ## Objective | ||
|
|
||
| Close ProbLog examples contract gaps so each curated example is structurally valid and behaviorally verifiable. | ||
|
|
||
| ## Done-when | ||
|
|
||
| `P2EX-STRUCT-004`, `P2EX-BEH-001`, and `P2EX-BEH-003` are enforced and tested as true. |
14 changes: 14 additions & 0 deletions
14
.tasks/archive/20260227-reconciliation-reset/task-h-problog-examples-portfolio.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| id: task-h-problog-examples-portfolio | ||
| level: high | ||
| status: pending | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T23:17:17Z | ||
| --- | ||
|
|
||
| ## Objective | ||
| Create a reusable ProbLog examples portfolio with runnable validation. | ||
|
|
||
| ## Done-when | ||
| - Examples schema and portfolio content exist with expected probability assertions. | ||
| - Automation runs the examples without network dependencies. |
15 changes: 15 additions & 0 deletions
15
.tasks/archive/20260227-reconciliation-reset/task-h-problog-language-and-api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| id: task-h-problog-language-and-api | ||
| level: high | ||
| status: done | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T21:41:19Z | ||
| --- | ||
| Objective | ||
| - Deliver the ProbLog language surface and public runtime API boundaries needed for implementation and integration. | ||
|
|
||
| Done-when | ||
| - Parser/API medium tasks are unblocked with concrete interfaces, syntax targets, and acceptance constraints. | ||
|
|
||
| Completion evidence | ||
| - Red-phase delegation produced failing tests at `test/problog-language-and-api.red.test.ts`. |
31 changes: 31 additions & 0 deletions
31
...27-reconciliation-reset/task-h-problog-nonground-query-parity-20260227181708.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| id: task-h-problog-nonground-query-parity | ||
| level: high | ||
| status: done | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T22:40:17Z | ||
| --- | ||
|
|
||
| ## Objective | ||
|
|
||
| Close the non-ground query parity gap for ProbLog behavior. | ||
|
|
||
| ## Done-when | ||
|
|
||
| Non-ground query parity is implemented and validated against the red parity expectations. | ||
|
|
||
| ## Red evidence (P2-SEM-008) | ||
|
|
||
| - Added/validated executable red spec in `test/problog-nonground-query-parity.red.test.ts` asserting non-ground query expansion returns per-ground-instance marginals for `p(1)` and `p(2)` and omits `p(X)` aggregate key. | ||
| - `npm run test:run -- test/problog-nonground-query-parity.red.test.ts` fails on assertion: expected `result.probabilities["p(1)"]` to be close to `0.3`, received `undefined`. | ||
| - Runtime loads cleanly via async import; failure is assertion-driven (no import crash). | ||
| - Red phase complete; implementation remains pending. | ||
|
|
||
| ## Green evidence (P2-SEM-008) | ||
|
|
||
| - Implemented non-ground `query(...)` expansion in `src/Prolog.ts` by grounding query terms against discovered constants and emitting per-instance query keys. | ||
| - `query(p(X)).` now resolves to grounded keys (for this case `p(1)` and `p(2)`) and no longer emits existential-only `p(X)` probability output. | ||
| - Validation passes: | ||
| - `npm run test:run -- test/problog-nonground-query-parity.red.test.ts` | ||
| - `npm run test:run -- test/problog-conformance-and-compat.red.test.ts` | ||
| - `npm run test:run -- test/prolog.test.ts test/runtime-behavior.test.ts` |
19 changes: 19 additions & 0 deletions
19
.../archive/20260227-reconciliation-reset/task-h-problog-nonground-query-parity.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| id: task-h-problog-nonground-query-parity | ||
| level: high | ||
| status: in-progress | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T22:18:23Z | ||
| --- | ||
|
|
||
| ## Objective | ||
| Define and deliver non-ground `query(...)` behavior that reaches ProbLog parity in this codebase. | ||
|
|
||
| ## Done-when | ||
| - Contract and implementation path for non-ground query handling are accepted. | ||
| - Work items tied to `P2-SEM-008` can be completed without ambiguity. | ||
|
|
||
| ## Red evidence | ||
| - 2026-02-27: Ran `npm run test:run -- test/problog-nonground-query-parity.red.test.ts`. | ||
| - Failing assertion: `expected undefined to be close to 0.3` at `test/problog-nonground-query-parity.red.test.ts:34`. | ||
| - Failure indicates non-ground `query(p(X))` does not expose per-instance marginals like `p(1)` and `p(2)`. |
35 changes: 35 additions & 0 deletions
35
...20260227-reconciliation-reset/task-h-problog-sampling-backend-20260227181708.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| id: task-h-problog-sampling-backend | ||
| level: high | ||
| status: done | ||
| blocked_by: [] | ||
| expires_at: 2026-03-20T22:40:17Z | ||
| --- | ||
|
|
||
| ## Objective | ||
|
|
||
| Deliver a real sampling backend path for ProbLog inference. | ||
|
|
||
| ## Done-when | ||
|
|
||
| Sampling mode executes stochastic estimation with seed-sensitive, sample-driven outputs. | ||
|
|
||
| ## Red evidence (P2-INF-002) | ||
|
|
||
| - Command: `npm run test:run -- test/problog-sampling-backend.red.test.ts` | ||
| - Result: 1 file failed, 3 tests failed, 0 runtime test errors. | ||
| - Assertion failures confirm sampling path still reuses exact semantics: | ||
| - Missing stochastic marker: expected `inference.randomness` to equal `"stochastic"`. | ||
| - Exact-reuse mismatch: expected sampling marginal to differ from exact marginal, received identical value (`0.37`). | ||
| - Seed insensitivity: expected at least one marginal to change across seeds, received no changes. | ||
| - Red phase complete: failing assertions capture the true-sampling backend gap. | ||
|
|
||
| ## Green evidence (P2-INF-002) | ||
|
|
||
| - Implemented stochastic sampling backend path in `src/Prolog.ts` using seeded Monte Carlo world selection over grounded probabilistic groups. | ||
| - Sampling results now expose stochastic metadata semantics: | ||
| - `inference.randomness: "stochastic"` | ||
| - `meta.executionPath: "sampling"` | ||
| - Validation: | ||
| - `npm run test:run -- test/problog-sampling-backend.red.test.ts` -> 1 file passed, 3 tests passed. | ||
| - `npm run test:run -- test/prolog.test.ts test/runtime-behavior.test.ts` -> 2 files passed, 12 tests passed. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file embeds an absolute local filesystem path, which is machine/user-specific and may leak developer workstation details into the repo. Consider removing it from version control and adding it to
.gitignore, or replacing it with a repo-relative path/config that is portable across environments.