Skip to content

docs(migration): record the direction rule in the placement rules and skills - #15281

Merged
marius-kilocode merged 3 commits into
v2from
direction-rule
Oct 20, 2026
Merged

marius-kilocode merged 3 commits into
v2from
direction-rule

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The host strategy (#15228) says where Kilo code lives on v2, but it never states the rule that follows from "Kilo is the host, OpenCode is a library": code moves from upstream files into Kilo-owned files and never back. Without it, the rung ladder reads as plain line arithmetic, and two wrong moves follow from that reading:

  • A seam in an upstream file proposed to remove a Kilo-owned mirror (five marked lines in cli/src/index.ts to delete the 162-line host entry). Wrong direction.
  • Kilo values hard-coded into upstream files, as in #15018: config/discovery.ts and config.ts import a Kilo module and replace upstream's file names and order, so upstream's own tests fail and six upstream test files had to be forked (config.test.ts has 34 upstream commits in 60 days). The files are registered as rung 3 seams although they carry Kilo imports.

The checkers count patches but do not classify them, and the skills agents load did not contain the rule, so nothing refused either move.

Why This Change Was Made

migration-tracking/plans/v2-host-strategy.md section 5 becomes the placement rules and the source of truth for adding a file to v2 or moving a change onto it. It states three rules: code moves one way; a Kilo-owned mirror of an upstream file is rung 2 and is never replaced by a seam; a patch adds and never changes an upstream default (upstream's own test files pass unchanged against the code without the host). The rung 3 and 4 distinction is made mechanical: any kilocode/ path, Kilo* identifier or Kilo string in the marked lines makes it rung 4, so a registration line that imports a Kilo plugin into an upstream list is a rung-4 call-out.

The documents agents read point at that section and repeat the rule in one sentence: AGENTS.md (v2 block), v2-feature-placement (new "Direction" and "Rejected moves" sections, rung 2 includes mirrors, TUI registration is rung 4, upstream tests are never edited), v2-migration, kilocode-merge-minimizer (the "keep inline when the change modifies an upstream ordering or heuristic" rule is replaced: such a change becomes a knob with upstream's default; "offer it upstream" is dropped, upstream does not take Kilo PRs), and the fork conventions.

Plans updated to match what landed: the two rejected approaches are recorded in section 2 with dates; section 9 step 1 no longer claims the root patches retired; step 4 and section 10 record the config re-home and the TUI call-out classification; U-E0-01 no longer says "builtin plugin list"; U-L3-01 lists the pending checker rules (rung classification, forked upstream tests, feature tags, mirroredFiles drift report). migration-context.md gains decisions 11 (direction) and 12 (config file names: Kilo names only, a deliberate change from v1, recorded for U-E1-07).

User Impact

None at runtime. Documentation, skills and plan rows only.

Evidence

  • bun script/check-shared-patches.ts --worktree: ok. The AGENTS.md block gains one line (the Direction bullet), so markedLines goes 316 to 317 in shared-patches.json, and the entry text names the new rule.
  • bun script/check-opencode-annotations.ts --worktree: ok (60 shared files against 775d1d0d713).
  • bun script/upstream/progress.ts --check: up to date (no map change).
  • bun run check: lint passes; @opencode/ai#typecheck fails locally with zstdCompressSync missing on node:zlib, a local @types/node mismatch present on origin/v2 and unrelated to this diff, which touches no TypeScript.

Placement

No shared source files touched. AGENTS.md is the existing rung-4 instructions block (shared-patches.json).

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

➖ v2 migration progress: 0.9% → 0.9% (0 done, 0 total, 0 dropped; 87/9829 cells)

Placement: 2 new marked lines in shared files (2 patch), 0 new kilo_port annotations, 0 new core-internal imports.

Ratchets: 9 core-internal imports (base 9); shared patches by rung 29 seam, 2 patch (base 29 seam, 2 patch).

No change to the progress map.

v2 migration progress map at this commit

Full map · how cells close

Comment thread migration-tracking/technical-notes/v2-fork-conventions.md Outdated
Comment thread AGENTS.md Outdated
Comment thread migration-tracking/plans/v2-host-strategy.md Outdated
@kilo-code-bot

kilo-code-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)

Incremental scope (e7ba30b..45cae5f):

  • .kilo/skills/kilocode-merge-minimizer/SKILL.md - the two mirroredFiles claims now hedge the pending registry (lines 21 and 39)
  • .kilo/skills/v2-feature-placement/SKILL.md - the rung-2 vocabulary and decision-table rows now hedge mirroredFiles (lines 19 and 166)
  • migration-tracking/plans/migration-context.md - decision 11 now says "listed as a mirror ... once U-L3-01 lands it" (line 45)

Notes: the single carried-forward suggestion is fixed in 45cae5f, and the earlier stale inline comments are outdated, so none are carried forward. The new wording matches v2-host-strategy.md section 5 and U-L3-01, which still lists mirroredFiles with the pinned hash and drift report as pending; git grep confirms no mirroredFiles or mirror drift implementation exists in script/upstream yet. Documentation-only change: no runtime code, no memory-leak surface, and no images added, so the markdown-image guidance did not apply. I did not run bun run check or the repo check scripts in read-only mode; the PR body reports check-shared-patches, check-opencode-annotations and the progress-map check as passing.

Previous Review Summaries (2 snapshots, latest commit e7ba30b)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit e7ba30b)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
migration-tracking/plans/migration-context.md 45 Decision 11 still says a mirror is "registered in mirroredFiles", a registry that does not exist yet; section 5 and the skill now hedge it
Files Reviewed (6 files)

Incremental scope (61cc673..e7ba30b):

  • AGENTS.md - no issues; the Direction bullet now links to section 5 instead of restating it
  • migration-tracking/plans/v2-host-strategy.md - no issues; mirroredFiles is hedged on line 125
  • migration-tracking/technical-notes/v2-fork-conventions.md - no issues; the second "source of truth" claim is gone

Targeted checks for the carried-forward mirroredFiles finding:

  • migration-tracking/plans/migration-context.md - 1 suggestion
  • .kilo/skills/kilocode-merge-minimizer/SKILL.md - same unhedged claim on lines 21 and 39, noted in the comment above
  • .kilo/skills/v2-feature-placement/SKILL.md - the mirror references are hedged; no issue

Notes: all three findings from the previous review are fixed in e7ba30b, so they are dropped rather than carried forward. This is a documentation-only change with no runtime code and no memory-leak surface. No images were added, so the markdown-image rule did not apply. I did not run bun run check or the repo check scripts in read-only mode; the PR body reports check-shared-patches, check-opencode-annotations and the progress-map check as passing. mirroredFiles was confirmed absent from script/upstream, and U-L3-01 still lists the registry as pending.

Fix these issues in Kilo Cloud

Previous review (commit 61cc673)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 3
Issue Details (click to expand)

SUGGESTION

File Line Issue
migration-tracking/technical-notes/v2-fork-conventions.md 85 Two contradictory "source of truth" claims: the added sentence names v2-host-strategy.md section 5, the retained sentence still names v2-migration/SKILL.md, which this PR changes to defer to section 5
AGENTS.md 11 The new Direction bullet restates section 5 instead of linking to it, against the fork-conventions "keep it short, link to the canonical document" guidance, and raises the markedLines ratchet 316 to 317
migration-tracking/plans/v2-host-strategy.md 125 Says a mirror "is registered in mirroredFiles", but the registry does not exist yet; U-L3-01 tracks it as pending and the companion skill correctly says "once it exists"
Files Reviewed (9 files)
  • .kilo/skills/kilocode-merge-minimizer/SKILL.md - no issues
  • .kilo/skills/v2-feature-placement/SKILL.md - no issues
  • .kilo/skills/v2-migration/SKILL.md - no issues
  • AGENTS.md - 1 suggestion
  • migration-tracking/plans/kilo-v2-migration-plan.md - no issues
  • migration-tracking/plans/migration-context.md - no issues
  • migration-tracking/plans/v2-host-strategy.md - 1 suggestion
  • migration-tracking/technical-notes/v2-fork-conventions.md - 1 suggestion
  • script/upstream/shared-patches.json - no issues

Notes: documentation-only change, no runtime code and no memory-leak surface. No images were added, so the markdown-image rule did not apply. The markedLines limit raise (316 to 317) matches the added AGENTS.md line and the PR body explains it. Checked the factual claims against the tree: the host entry is 162 lines, script/upstream/utils/config.ts exists, mirroredFiles does not exist anywhere in script/upstream, and packages/tui/src/plugin/builtins.ts is still registered at rung 3 in shared-patches.json (the PR defers the relabel to U-L3-01). The docs' enumeration of v1 config file and directory names matches the #15018 convention recorded in the plan.

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash-1017 · Input: 42.4K · Output: 3.3K · Cached: 251.9K

Review guidance: REVIEW.md from base branch v2

Comment thread migration-tracking/plans/migration-context.md Outdated
@marius-kilocode
marius-kilocode merged commit 99f2a05 into v2 Oct 20, 2026
22 checks passed
@marius-kilocode
marius-kilocode deleted the direction-rule branch October 20, 2026 10:21
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.

2 participants