Skip to content

fix(cli): emit a flat kilo build's rules through one placement owner - #1367

Merged
blafourcade merged 4 commits into
nextfrom
fix/kilo-flat-build-emits-rules
Nov 25, 2026
Merged

blafourcade merged 4 commits into
nextfrom
fix/kilo-flat-build-emits-rules

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

🎯 What & why

A flat kilo build (translate --to kilo --as flat) and an install from its built tree dropped a plugin's rules and warned they were out of scope, while a local install delivered them. Supersedes #1069, crediting @BlandineRdl.

🛠️ How it works

  • The kilo build contract now declares a rules artifact. Rules land at the top of the rules folder named by plugin and group, and the config lists each plugin's rules glob in instructions.
  • Build and install share one placement and one scope rule, so both write the same bytes. A path-scoped rule keeps its scope stated in its body. The layout's own predicate decides the scope, through one helper.
  • The built-tree install owns those paths and lists the same glob. The glob comes from the shared owner through the request's tool, with no per-profile import.
  • The out-of-scope warning no longer names rules for a tool whose build carries them. The generated compatibility column is labelled as what a build carries, since an install delivers rules to tools a build leaves without.

🧪 How to verify

  • cd cli && pnpm exec lefthook run pre-push: green. Its cli-test job was skipped by the gate witness because this exact tree had already passed it.
  • pnpm exec lefthook run pre-commit --all-files: green on this HEAD (pnpm test scripts suite: 2665 pass, 0 fail).
  • cd cli && pnpm build: bundle 880.9 KB, within the 897 KB budget. Budget not raised.
  • Mutation: forcing the scope predicate to always hold turns four tests red, across the flat-paths, build-flat-rules, install-flat-rules and engine suites. Restored after.

⚠️ Heads-up

  • A rule that mentions a path is not rewritten to the tool's link syntax at build, as an install does. No shipped plugin rule carries one. A plugin that does must get the install's link form first. Not coded until one exists.
  • docs/COMPATIBILITY.md and the 'Rules in a build' column label are not touched here. The PR that owns that file decides whether the label stays; whichever lands second regenerates.
  • The scripts suite failed twice on the pre-commit gate, each time because a test run reported changes under the shared .git/hooks. It was green on the third run at this HEAD. Not root-caused.

🔗 Linked issue

Supersedes #1069, crediting @BlandineRdl

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

blafourcade and others added 3 commits November 25, 2026 17:17
…l places them

A flat kilo build (translate --to kilo --as flat) and an install from its built
tree dropped a plugin's rules and warned they were out of scope, while a local
install delivered them.

The tool's build contract now declares a rules artifact. Rules land at the top
of the rules folder named by plugin and group, a path-scoped rule keeps its
scope stated in its body, and the config lists each plugin's rules glob in
instructions. The build and the install share one placement and one scope
rule, so both write the same bytes. The built-tree install owns those paths and
lists the same glob. The out-of-scope warning no longer names rules for a tool
whose build carries them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…install

Both routes read the layout's own predicate to state a rule's scope and strip the
section prefix through one helper. The generated compatibility column is labelled
as what a build carries, since an install delivers rules to tools a build leaves
without.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rule's scope statement is decided once in rule-scope, called by the build and
the install route. The installation side lists a plugin's placed rules through
one helper. The compatibility column label is left to the table's owner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@blafourcade
blafourcade marked this pull request as ready for review November 25, 2026 18:58
@blafourcade
blafourcade requested a review from a team as a code owner November 25, 2026 18:58
@blafourcade
blafourcade merged commit f9f3e77 into next Nov 25, 2026
39 of 40 checks passed
@blafourcade
blafourcade deleted the fix/kilo-flat-build-emits-rules branch November 25, 2026 18:58
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