Repository navigation
feat(cli): emit rules in Kilo flat builds - #1069
Open
BlandineRdl wants to merge 4 commits into
Open
BlandineRdl wants to merge 4 commits into
BlandineRdl wants to merge 4 commits into
Conversation
A Kilo flat archive dropped canonical plugin Rules although Kilo loads Markdown Rules listed in kilo.json[c] instructions. All-files Rules are now materialized under .kilo/rules/ and appended to instructions after user entries, idempotently. A path-scoped Rule fails the build instead of being silently broadened. The bundle budget rises to 725 KB. Closes ai-driven-dev#868 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two Rules flattening to one Kilo filename raised FlatTargetExistsError, whose --force hint cannot resolve the clash. A dedicated error now names both source Rules and the shared destination. The README states that a Rule's links to files the build does not emit stay unchanged. Refs ai-driven-dev#868 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plugin install, setup and remove for Kilo build their cache tree through the flat strategy, so a Rule scoped by `paths` started failing them where `rules/` used to be skipped. The flat strategy now takes the caller's policy for a Rule the target cannot scope: `aidd translate` still fails the build, while the install cache build skips the Rule, names it with its paths in a warning on the real logger, and installs the rest. The Kilo contract declares the scope check instead of throwing from its transform, and `instructions` never lists a skipped Rule. The runtime e2e marker loses its tracker id, and the bundle budget entry drops the issue number. Refs ai-driven-dev#868 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A positional `force` boolean reads as a bare true or false at every call site, and overwrite and the policy for an unscopable Rule are both the caller's choices for one build. One named options object carries them, so the strategy's dependency count stays at what the ratchet admits and the ratchet keeps meaning a new collaborator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@waewoo hello ! J'ai pris une issue sur un sujet sur lequel tu bosses habituellement ( désolé j'avais pas fait attention ) si jamais tu veux en discuter c'est avec plaisir ! :) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🎯 What & why
A Kilo flat build (
aidd translate <src> --to kilo --as flat) dropped canonical plugin Rules, although Kilo loads Markdown Rules listed inkilo.json[c].instructions. All-files Rules now ship with the archive and are wired into the resolved Kilo config.🛠️ How it works
buildKiloFlatContract()declaresrulesas supported: each Rule is written to.kilo/rules/<plugin>-<group>-<name>.md, with relative links relocated.pathsfrontmatter (a scope Kilo cannot express) failsaidd translate --to kilo --as flatwithPathScopedRuleUnsupportedError; nothing is emitted or referenced.plugin install/setup/remove/updatefor Kilo skip such a Rule with a warning naming the plugin, the Rule and its paths, so one scoped Rule never blocks an install (InexpressibleRulePolicy:failby default,skipin the install cache build).emitConfigArtifactappends the sorted Rule paths toinstructionsafter the user's entries (buildOpencodeFlatConfigmergedKeys), so a rebuild changes nothing.writeRulesonBuildOutputStrategy(flat writes, marketplace no-op): the seam feat(cli): emit rules and commands in OpenCode flat builds #789 (OpenCode) can reuse. The skippedrules/warning fires only when nothing was emitted.FlatRuleNameClashErrornaming both.globUpfrom the session directory to the worktree (packages/opencode/src/session/instruction.ts), not from the config file's folder.Refactor: one named options object for the flat build
Supporting the install/translate split needed a new caller-chosen setting on
FlatBuildStrategy, which would have been its 9th constructor parameter and forced raising the dependency ratchet inorchestrator-deps.arch.test.ts. Instead,refactor(cli): pass flat build options as one named objectapplies Introduce Parameter Object:force(a positional boolean, unreadable at call sites:…, true, absOut, …) and the newinexpressibleRulespolicy move intoFlatBuildOptions { force, inexpressibleRules? }.fsorlogger: they form one concept.The commit sits at the end of the branch rather than before the feature commits, to avoid rewriting pushed history; a squash merge flattens it anyway.
🧪 How to verify
cd cli && pnpm test(6889 passed, 1 skipped: the gated Kilo runtime e2e)pnpm lint,pnpm typecheck,pnpm knip,pnpm buildall passcli / Kilo runtime smokerunstests/e2e/kilo-runtime.e2e.test.ts, which now asserts the Rule is listed ininstructionsand its marker reaches the modelcli / Kilo runtime smokeCI job (nokilobinary locally)..kilo/rules/*.mdload even without aninstructionsentry; files in a subdirectory load only when listed;pathsfrontmatter is ignored: a scoped Rule reaches every session. This is why a path-scoped Rule is refused (translate) or skipped (install) rather than emitted;instructionsentries are explicit, not duplicated.aidd plugin install <local path> --tool kilocopies Rules verbatim into.kilo/rules/<plugin>/, so Kilo loads none of them. Tracked in fix(cli): kilo local-path install leaves plugin rules inert #1081.aidd-testfixture Rule is path-scoped, so the Kilo e2e uses an all-files copy; a dedicated e2e asserts the unmodified fixture is refused.cli/README.md); Rules removed upstream are not pruned on rebuild.rules/today, so the real framework's Kilo build output is unchanged.🔗 Linked issue
Closes #868
✅ I certify
🤖 Generated with Claude Code