Add versioned project syntax observations #363

Closed
nsaspy wants to merge 1 commit from rage/96-versioned-syntax-facts into main
Owner

Closes #96.

Summary

  • add bounded, versioned rlm_project_syntax CST observations over the existing Project/File/grammar registry
  • preserve closed parse/node identities, fields, ranges, errors, UTF-8 text reads, exact source/grammar provenance, and explicit current/stale/pending/partial states
  • route materialization through the canonical execute -> Future -> sync await direction with deadlines and cooperative native cancellation
  • add transactional inert grammar-pack registration and registry extension evidence for arbitrary host-provided languages
  • add a pinned Nix grammar bundle for C, Lua, Tree-sitter Query, Python, JavaScript, Markdown, JSON, Org, Common Lisp, and Nim
  • exercise source code and structured non-code documents through the same generic projection

Runtime invariant

Tree-sitter produces observational project state only. Grammar registration remains inert, activation remains a trusted host operation, native handles never become durable identities, and parsing grants no filesystem, tool, process, network, authority, or source-execution capability. Current observations cannot silently mix parse generations or survive blocked, cancelled, stale, or destroyed registry state as verified current evidence.

Important non-goals

  • no Tree-sitter query/capture packs; owned by #97
  • no normalized symbols, references, calls, or imports; owned by #98
  • no incremental reparsing or semantic invalidation; owned by #99
  • no planner-specific parser, coding-agent product behavior, source execution, or second scheduler
  • no claim that the standard ten-grammar bundle is a finite universal language catalog; additional grammars use the same generic host registration contract

Verification

Exact candidate: bf13637

  • aggregate PlUnit: 96 suites, 1179/1179 passed, 0 failed, 0 timeout, 0 blocked, 0 fixme
  • native/Nix project syntax: 21/21 passed across the ten-grammar bundle
  • Tree-sitter 0.20.8 compatibility syntax compile passed for changed C sources
  • swipl -q -s test/check_runtime.pl
  • swipl -q -s test/load_all.pl
  • swipl -q -s test/run_tests.pl
  • swipl -q -s benchmark/run.pl -- deterministic (16/16)
  • swipl -q -s benchmark/run.pl -- deep-experiment (15/15)
  • swipl -q -s bin/prolog-rlm.pl -- demo --json
  • make research-approval (19 records)
  • nix flake check path:. --no-update-lock-file --print-build-logs
  • git diff --check

Independent adversarial review found and drove fixes for native API compatibility, traversal bounds, publication/destruction races, failed-refresh currentness, source-hash provenance, async cancellation, grammar-pack atomicity, extension validation, and platform-specific checks. The final review reported no high-severity release blockers.

The pre-existing singleton warnings tracked by #329 are unchanged by this slice.

Closes #96. ## Summary - add bounded, versioned `rlm_project_syntax` CST observations over the existing Project/File/grammar registry - preserve closed parse/node identities, fields, ranges, errors, UTF-8 text reads, exact source/grammar provenance, and explicit current/stale/pending/partial states - route materialization through the canonical `execute -> Future -> sync await` direction with deadlines and cooperative native cancellation - add transactional inert grammar-pack registration and registry extension evidence for arbitrary host-provided languages - add a pinned Nix grammar bundle for C, Lua, Tree-sitter Query, Python, JavaScript, Markdown, JSON, Org, Common Lisp, and Nim - exercise source code and structured non-code documents through the same generic projection ## Runtime invariant Tree-sitter produces observational project state only. Grammar registration remains inert, activation remains a trusted host operation, native handles never become durable identities, and parsing grants no filesystem, tool, process, network, authority, or source-execution capability. Current observations cannot silently mix parse generations or survive blocked, cancelled, stale, or destroyed registry state as verified current evidence. ## Important non-goals - no Tree-sitter query/capture packs; owned by #97 - no normalized symbols, references, calls, or imports; owned by #98 - no incremental reparsing or semantic invalidation; owned by #99 - no planner-specific parser, coding-agent product behavior, source execution, or second scheduler - no claim that the standard ten-grammar bundle is a finite universal language catalog; additional grammars use the same generic host registration contract ## Verification Exact candidate: `bf13637` - aggregate PlUnit: 96 suites, 1179/1179 passed, 0 failed, 0 timeout, 0 blocked, 0 fixme - native/Nix project syntax: 21/21 passed across the ten-grammar bundle - Tree-sitter 0.20.8 compatibility syntax compile passed for changed C sources - `swipl -q -s test/check_runtime.pl` - `swipl -q -s test/load_all.pl` - `swipl -q -s test/run_tests.pl` - `swipl -q -s benchmark/run.pl -- deterministic` (16/16) - `swipl -q -s benchmark/run.pl -- deep-experiment` (15/15) - `swipl -q -s bin/prolog-rlm.pl -- demo --json` - `make research-approval` (19 records) - `nix flake check path:. --no-update-lock-file --print-build-logs` - `git diff --check` Independent adversarial review found and drove fixes for native API compatibility, traversal bounds, publication/destruction races, failed-refresh currentness, source-hash provenance, async cancellation, grammar-pack atomicity, extension validation, and platform-specific checks. The final review reported no high-severity release blockers. The pre-existing singleton warnings tracked by #329 are unchanged by this slice.
Add versioned project syntax observations
Some checks failed
CI / REAL OpenRouter integration (pull_request) Has been skipped
Nix flake / Flake package and clean runtime load (pull_request) Failing after 8s
Clean SWI pack install / Install and load copied pack (pull_request) Successful in 1m42s
Tree-sitter FFI / Direct SWI-Prolog Tree-sitter FFI (pull_request) Successful in 5m24s
CI / Deterministic unit and load checks (pull_request) Successful in 4m41s
Paid OpenRouter / Pinned paid OpenRouter integration (pull_request) Failing after 5m23s
bf13637af8
Author
Owner

Exact-head verification at bf13637af833011fab2e29da41df37b1b09c214c (clean worktree ~/git/worktrees/prolog-rlm-issue-96, branch rage/96-versioned-syntax-facts):

  • swipl -q -s test/check_runtime.pl — pass
  • swipl -q -s test/load_all.pl — pass (only pre-existing #329 singleton warnings)
  • swipl -q -s test/run_tests.pl — 96 suites, 1179/1179 passed, 0 failed/timeout/blocked
  • benchmark/run.pl -- deterministic — 16/16
  • benchmark/run.pl -- deep-experiment — 15/15
  • benchmark/run.pl -- deep-integration (paid, z-ai/glm-5.3-flash) — 6/6, quality 1.00, replicating and clearing the #343 core_minimal_depth_1 stochastic rejection (all cases: requested_model = selected_model = z-ai/glm-5.3-flash)
  • bin/prolog-rlm.pl -- demo --json — pass
  • git diff --check — clean
  • make research-approval — 19/19 tracked records
  • nix flake check path:. --no-update-lock-file --print-build-logs — all checks passed (ten-grammar bundle, native 21/21, FFI compile)
  • CI exact head: all required checks green after the #343 re-run; REAL OpenRouter integration (ci.yml workflow_dispatch-only) correctly skipped; pinned paid lane is the credentialed PR lane and passed

Merge state: MERGEABLE/CLEAN. Stopping at the PR boundary per discipline — merge decision is the owner's.

Exact-head verification at `bf13637af833011fab2e29da41df37b1b09c214c` (clean worktree `~/git/worktrees/prolog-rlm-issue-96`, branch `rage/96-versioned-syntax-facts`): - `swipl -q -s test/check_runtime.pl` — pass - `swipl -q -s test/load_all.pl` — pass (only pre-existing #329 singleton warnings) - `swipl -q -s test/run_tests.pl` — 96 suites, 1179/1179 passed, 0 failed/timeout/blocked - `benchmark/run.pl -- deterministic` — 16/16 - `benchmark/run.pl -- deep-experiment` — 15/15 - `benchmark/run.pl -- deep-integration` (paid, `z-ai/glm-5.3-flash`) — **6/6, quality 1.00**, replicating and clearing the #343 `core_minimal_depth_1` stochastic rejection (all cases: `requested_model` = `selected_model` = `z-ai/glm-5.3-flash`) - `bin/prolog-rlm.pl -- demo --json` — pass - `git diff --check` — clean - `make research-approval` — 19/19 tracked records - `nix flake check path:. --no-update-lock-file --print-build-logs` — all checks passed (ten-grammar bundle, native 21/21, FFI compile) - CI exact head: all required checks green after the #343 re-run; `REAL OpenRouter integration` (ci.yml `workflow_dispatch`-only) correctly skipped; pinned paid lane is the credentialed PR lane and passed Merge state: MERGEABLE/CLEAN. Stopping at the PR boundary per discipline — merge decision is the owner's.
nsaspy closed this pull request 2026-09-04 22:56:44 +00:00
Some checks failed
CI / REAL OpenRouter integration (pull_request) Has been skipped
Nix flake / Flake package and clean runtime load (pull_request) Failing after 8s
Clean SWI pack install / Install and load copied pack (pull_request) Successful in 1m42s
Tree-sitter FFI / Direct SWI-Prolog Tree-sitter FFI (pull_request) Successful in 5m24s
CI / Deterministic unit and load checks (pull_request) Successful in 4m41s
Paid OpenRouter / Pinned paid OpenRouter integration (pull_request) Failing after 5m23s

Pull request closed

Sign in to join this conversation.
No description provided.