Rulings reach the work they govern — milestone 444 steps 3-4 #194

Merged
bvandeusen merged 3 commits from dev into main 2026-10-03 08:29:25 -04:00
Owner

Completes milestone 444 "Rulings reach the work they govern".

  • #4756 "A System carries path patterns — the files that are that area" — System.path_patterns (migration 0113), validated and matched with PurePosixPath.full_match; settable via REST, MCP and the Systems UI; carried by backup.
  • #4757 "A command or edit touching a System's paths shows that System's rulings, once per session" — a deterministic rulings arm in both PreToolUse hooks (/tool-rules for Bash, /prior-art for Write/Edit). Full rulings on first touch, a one-line reference after, session ledger <sid>.rulings.ids. Surfacings and get_system pulls go to the new system_usage_events table (migration 0114, backup v20).
  • Plugin version 2026.10.03.0308.

CI green on dev (run 7940).

🤖 Generated with Claude Code

Completes milestone 444 "Rulings reach the work they govern". - **#4756 "A System carries path patterns — the files that are that area"** — `System.path_patterns` (migration 0113), validated and matched with `PurePosixPath.full_match`; settable via REST, MCP and the Systems UI; carried by backup. - **#4757 "A command or edit touching a System's paths shows that System's rulings, once per session"** — a deterministic rulings arm in both PreToolUse hooks (`/tool-rules` for Bash, `/prior-art` for Write/Edit). Full rulings on first touch, a one-line reference after, session ledger `<sid>.rulings.ids`. Surfacings and `get_system` pulls go to the new `system_usage_events` table (migration 0114, backup v20). - Plugin version 2026.10.03.0308. CI green on dev (run 7940). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 3 commits 2026-10-03 08:29:16 -04:00
feat(systems): a System names its files — path patterns stored, validated and matched (milestone 444 step 3, #4756)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 15s
CI & Build / TypeScript typecheck (push) Successful in 54s
CI & Build / integration (push) Successful in 1m6s
CI & Build / Python tests (push) Successful in 1m50s
CI & Build / Build & push image (push) Successful in 43s
a113c72b4f
A System gains path_patterns: globs relative to the repo root (* within one
directory, ** across any depth, a plain directory covering everything under
it). One service validates them for every door, so the web UI and MCP refuse
the same bad pattern with the same message. systems_for_paths resolves paths
to every active System that covers them, which step 4 (#4757) uses to deliver
an area's rulings when its files are touched.

- schema: systems.path_patterns JSONB NOT NULL default [] (migration 0113)
- service: normalize_path_patterns, path_matches, systems_for_paths
- routes + MCP create_system/update_system accept it; [] clears
- web UI: a Files field in the create and edit forms, patterns on the card
- backup carries it through export and restore
- using-scribe reflex 7: tagging work keeps a System's files current

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(rulings): a command or edit touching an area's files shows its rulings, once per session (milestone 444 step 4, #4757)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 54s
CI & Build / integration (push) Successful in 1m6s
CI & Build / Python tests (push) Failing after 1m22s
CI & Build / Build & push image (push) Skipped
556872c039
A System's rulings (the Rulings section of its description) now reach the
work by path, not by similarity. Both PreToolUse arms resolve the files a
command or edit names to the Systems whose path_patterns cover them, and the
first touch in a session shows each area's rulings in one line; a repeat is
a one-line reference. A lookup, so no floor, no budget, no retrieval_logs row.

- services/system_rulings: parse_rulings, command_paths (reads and writes,
  relative to the repo root from any cwd; flags, URLs, globs skipped),
  rulings_for_paths
- /tool-rules takes root, cwd and seen_ruling_systems; /prior-art takes
  seen_ruling_systems; both return ruling_system_ids
- hooks share <sid>.rulings.ids (cleared on compaction by the ledger naming
  convention); the Bash hook sends the repo root and cwd
- system_usage_events (migration 0114): surfacings by source, pulls from
  get_system; carried by backup (v20) through the system map
- writing-records: rulings also arrive when the area's files are touched

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(rulings): the hook/route parity guards pin the rulings params (#4757)
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / integration (push) Successful in 49s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / Python tests (push) Successful in 1m49s
CI & Build / Build & push image (push) Successful in 33s
891f375715
CI 7939 went red on test_the_hook_and_the_route_agree_on_every_parameter_name:
the Bash hook now sends root and cwd, and the guard pins the exact set. Both
guards (tool-rules and prior-art) now also pin seen_ruling_systems, spelled
once in scribe_rulings_query, and check the routes read all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bvandeusen merged commit a24f6b6b41 into main 2026-10-03 08:29:25 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledScribe#194