Skip to content

refactor: build option-relation rulebase via copy-rulebase#3

Merged
takeokunn merged 1 commit into
mainfrom
chore/consolidate-branch-fixes
Jul 19, 2026
Merged

refactor: build option-relation rulebase via copy-rulebase#3
takeokunn merged 1 commit into
mainfrom
chore/consolidate-branch-fixes

Conversation

@takeokunn

Copy link
Copy Markdown
Collaborator

Summary

Comprehensively audited every branch and worktree in this checkout
(main, feat/cl-prolog-cl-weave, feat/cl-prolog-weave,
feat/ci-ubuntu-only, feat/cl-prolog-cl-weave-integration, plus the four
local worktrees) for fixes that never made it into main, now that PR #2
landed the cl-prolog/cl-weave dogfood integration. This is the one thing
that survived the filter as a genuinely useful, verified, low-risk,
not-already-covered fix.

  • make-option-relation-rulebase now uses cl-prolog:copy-rulebase
    instead of hand-reconstructing a rulebase via make-rulebase +
    rulebase-visible-clauses. copy-rulebase is the library's own
    detached-copy primitive (clauses and full runtime state — operator
    tables, flags, module/source registries), so this is both simpler and
    more robust than re-deriving the same result from a narrower accessor.
    Behavior-preserving; confirmed via the full test suite.

What else I found and why it's excluded

  • feat/ci-ubuntu-only, and the a8b7cf2/0700837 commits unique to
    feat/cl-prolog-weave — no unique content; fully subsumed by what's
    already on main (or an empty checkpoint commit).
  • 7b65686 "build: unify cl-weave input" (dedup a nested flake input) —
    fixes a problem specific to the old flake.nix shape (cl-prolog as a
    proper flake input with .packages.${system}.default). Main's current
    flake.nix fetches cl-weave/cl-prolog as plain (flake = false)
    sources via .outPath instead, so the duplicate-input problem this
    commit fixes doesn't exist here.
  • 5bdd5e2 "fix: stabilize option relation ordering" (topological sort
    via Kahn's algorithm) — targets the same non-deterministic-comparator
    bug that PR feat: dogfood cl-prolog/cl-weave with option groups, perf, and hardening #2 already fixed on main, via a different (cheaper,
    closure-size-based) comparator. Verified main's current
    validate-option-relationships already handles a 3-level transitive
    :requires chain correctly, so re-doing the fix via topological sort
    would just be a redundant, more expensive alternative — not a gap.
  • 159eb01 "ci: enforce dogfood coverage thresholds" (the other half of
    this commit, unlike the copy-rulebase change) — adds an
    sb-cover-based coverage-threshold gate to flake.nix. It calls
    cl-weave:make-coverage-summary, cl-weave:ensure-coverage-thresholds,
    and cl-weave:coverage-summary-plist, none of which exist in the
    cl-weave version main now depends on (its coverage API is now
    coverage-statistics / reset-coverage / save-coverage instead).
    Porting this would mean writing new code against an API I can't fully
    validate locally (no Linux nix builder on this machine), so it's left
    out rather than shipped unverified. Worth a follow-up if coverage
    gating in CI is still wanted.
  • dependabot/github_actions/actions/checkout-7 (open PR chore(deps): bump actions/checkout from 4 to 7 #1) — routine
    Dependabot maintenance; left for Dependabot to manage rather than
    folded in here.
  • The cl-cli-worktree scratch worktree — untracked files only, no
    commits, and older than every other snapshot examined (missing
    src/option-relations.lisp entirely). Nothing to recover from it.

Test plan

  • sbcl --non-interactive --load tests/run-tests.lisp --eval '(cl-cli/tests:run-tests)' --quit (with CL_WEAVE_SOURCE_DIR /
    CL_PROLOG_SOURCE_DIR pointed at sibling checkouts) →
    172 passed, 0 failed, 0 errored.

make-option-relation-rulebase reconstructed a fresh rulebase from
*option-relation-rules*'s visible clauses by hand. cl-prolog exposes
copy-rulebase for exactly this (a detached copy including full runtime
state, not just clauses), so use it instead of hand-rolling the same
result from rulebase-visible-clauses.

Recovered while auditing every branch/worktree in this checkout for
fixes that never made it to main: this was one half of
159eb01 "ci: enforce dogfood coverage thresholds" on the
feat/cl-prolog-cl-weave reference branch. The other half of that
commit (a coverage-threshold CI gate) targets cl-weave APIs
(make-coverage-summary, ensure-coverage-thresholds,
coverage-summary-plist) that no longer exist in the cl-weave version
main now depends on, so it isn't a like-for-like port and is left out.
@takeokunn
takeokunn merged commit 1e946ad into main Jul 19, 2026
1 check passed
@takeokunn
takeokunn deleted the chore/consolidate-branch-fixes branch July 19, 2026 11:16
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