fix(kiro): resolve a rule reference kiro does not write by where that rule is (0.8.5) - #25
Merged
Merged
Conversation
… rule is Spec 17: a reference to a rule kiro does not write keeps .claude/rules/ when claude-code writes it, points into AGENTS.md when only that holds it, or reads "<x> (rule not in this workspace)"; unknown names keep the rewrite and are reported. One resolver for agents-md and kiro.
…hat 0.8.5 changes Kiro target paragraph now covers the same resolution agents-md does. Upgrading section has the new to 0.8.5 notes.
0.8.4 → 0.8.5 in package.json, package-lock.json and src/cli.ts.
serializeFrontmatter ignores the description when frontmatterRaw is set, so resolving it adds spurious entries to the kiro warning.
In kiro mode, K1 and unknown link fragments passed through unchanged. Now they go through the blanket rewrite, matching 0.8.4's behavior.
…y once - Restore the comment about right-boundary class not being RULE_NAME_CHARS - Restore the comment about / going before - in otherPattern - Restore offset and order comments for match collection and sorting - Add UNKNOWN_NAME_KIND constant to make unknown discriminant explicit - Read agent body once and derive both resolved and rewritten versions from it
- Clarify 'at most one kiro: warning about rule references per plan' - Clarify 'every rule a kiro text cites is one kiro writes' - Move parenthetical about agent/command/skill resolution to its own sentence - Update to 0.8.4: '0.8.5 addresses it in part — see to 0.8.5'
0.8.5 builds the result forward, not reverse; cite spec 17 §4.3 (the contract table), not §4.6 (the no-move guarantee). Restore three 0.8.4 comments the merge dropped.
A period makes the exception its own sentence; "Files are" clarifies that the UTF-8/CRLF applies to all kiro output, not just unknown names.
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.
Summary
This PR bumps the version to 0.8.5. Merging it publishes
craftar@0.8.5to npm once the release is approved in thenpmenvironment.What changes. Until now, the kiro emitter rewrote every
.claude/rules/into.kiro/steering/, whether or not kiro writes that file. A reference to a rule kiro does not write became a path to nothing. Whenclaude-codewas also a target, the path it replaced was the one that existed. This PR implements the approved spec rule references in the kiro files: each reference is now resolved by where the named rule actually is.[t](.claude/rules/<x>.md).kiro/steering/<x>.md(a rule or asteeringingredient).kiro/steering/<x>.md, as beforeclaude-codewrites it.claude/rules/<x>.md, as the Forge wrote itAGENTS.mdholds it (agents-mdis a target)AGENTS.md (rule: <x>)[t](AGENTS.md)<x> (rule not in this workspace)t (<x>, rule not in this workspace).kiro/steering/<x>.md, as before, now reporteddescriptionof a hand-written command (one with no raw frontmatter), and skill text files.steeringbody and the banner are untouched. Patterns and other non-references keep the directory rewrite.resolveRuleRefsinsrc/emitters/shared.tsserves bothagents-mdand kiro through a mode parameter. Itsagents-mdmode is byte-identical to 0.8.4: the reviewer fuzzed both modes against 0.8.4.resourcesdo not move.agentResourcesstill reads the original, blanket-rewritten text.kiro:warning about rule references per plan. It has two parts: the references reworded as "rule not in this workspace", and the unknown names, which are still rewritten. It never changes an exit code.Which workspaces see
updateOnly files under
.kiro/change. The user approved the kiro byte change at the spec's checkpoint, before the commit, after seeing three things:regen-goldenproduces no diff undertest/golden/;importproduces keeps every byte;.kiro/before/after of the spec's Forge for three target sets.syncon 0.8.5craftar importproduced)claude-codewrites it.claude/rules/<x>.mdAGENTS.mdholdsAGENTS.md (rule: <x>)<x> (rule not in this workspace), and the warningdescriptioncites a ruledescriptionis resolved, including the directory rewriteAn affected workspace shows those files as
update, andcraftar sync --checkexits 1 until it syncs.Tests
resourcesassertion of test 8 and the K1 part of test 15 pin output that must not move, and they pass on both versions.ingredient.yamldescription;planForhelper intest/emitters/kiro.test.ts. It gained atargetsparameter whose default is the old value.Known limit, fixed by 0.8.6
Link text is treated as opaque. In particular,
[`.claude/rules/cc-only.md`](.claude/rules/cc-only.md)for a rule kiro does not write keeps a.kiro/steering/cc-only.mdpath in its text. Spec §4.3 specifies this ("everything else keeps today's rewrite"), andAGENTS.md(0.8.4) behaves the same way. The user scheduled 0.8.6, right after this release, to fix link text in both emitters with its own byte checkpoint.Disclosures
descriptionis emitted unquoted (description: Opens per AGENTS.md (rule: md-only)).serializeFrontmatterwrites values verbatim by design, for Claude Code round-trips.[. It is unchanged from 0.8.4.Test plan
npm run typecheck: exit 0 onfd98af6.npm run build: exit 0.test/ci.test.ts(Linux): 840 passed / 5 skipped.npx tsx test/helpers/regen-golden.ts: no diff undertest/golden/.9328c40for an imported sandbox and the spec's Forges, and only the lines in the spec's §4.4 move;node-cli-reviewer2 rounds, the second without blocks or should-fixes;docs-author2 rounds, the README clean. The nits that change no bytes are applied infcc5edfandfd98af6.37289198703,37289248338).