Skip to content

feat(upstream): adopt the host strategy in the progress map - #15231

Merged
marius-kilocode merged 5 commits into
v2from
map-rungs
Oct 19, 2026
Merged

marius-kilocode merged 5 commits into
v2from
map-rungs

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The progress map was built before the host strategy (#15228, migration-tracking/plans/v2-host-strategy.md section 8). A v1 patch cell closed only with a kilocode_change(<feature>:<id>) marker, and markers are allowed only in shared upstream files. Under the host strategy most v1 patches move to plugin hooks in Kilo-owned files (rung 1), so those cells could never close. The map also called these cells "hooks", which collides with plugin hooks, and it did not show where a done cell landed or the two numbers that the strategy ratchets.

Closes #15230. Part of #13750. Builds on #15228, now merged into v2.

Why This Change Was Made

Section 8, items 1 to 5:

  1. hook is now patch: Kind, progress.json, README terms and counting rules, and the v2-migration and v2-feature-placement skills.
    ID decision: cell IDs change from hook:<feature>:<hash> to patch:<feature>:<hash>, with a one-time mapping. The change breaks no marker: a marker carries only <feature>:<hash>, rg "kilocode_change\(" packages finds no tagged marker on v2, and dispositions.json is empty. The hash does not change. The one-time mapping is in --compare: it reads a base progress.json written before the rename with "hook" mapped to "patch", so this PR and PRs on an older base show no false delta.
  2. Second done-proof: // kilo_port(<feature>:<id>) in a Kilo-owned file under packages/, found by the same git grep that finds kilocode_change(<feature>:<id>) in shared files. An unknown ID fails the run, with the same message style as dispositions.json. A proof in the wrong kind of file (kilo_port in a shared file, or a tagged marker in a Kilo-owned file) also fails, so a wrong proof cannot leave a cell open without notice. Unknown tagged markers now fail too; v2 has none. A cell proved by both is reported once, at the highest rung. The temporary state: "ported" bridge sentence is removed from both skills.
  3. Landed by rung: each proved cell records its rung: 2 (host) for kilo_port in packages/kilo-cli, 1 (plugin) in other Kilo-owned files, and for a marker the rung of its file in shared-patches.json (3 seam, 4 patch). Shown per feature in a new Landed column (for example 2 plugin, 1 seam), as a summary line, in the treemap legend, and in progress.json (summary.landed, features[].landed, and landed per cell ID).
  4. Two ratchets in the README summary, progress.json (summary.coreImports with the coreImports list, summary.sharedPatches) and the PR comment: the distinct core-internal upstream modules (@opencode/core/*, or relative imports into packages/core/src outside kilocode/) that non-test files of packages/kilo-* and packages/*/src/kilocode import, and the shared patches by rung in shared-patches.json. A packages/kilo-*-core logic package that imports anything from @opencode/* fails the run. Mirrored files join when mirroredFiles exists in the sync tooling (not yet).
  5. Placement line in the PR comment: --compare <base.json> <head.json> <pr.diff> counts new marked lines in shared files by rung (the marker coverage rules of check-shared-patches.ts, applied to the head file, so a line added inside an existing block counts), new kilo_port annotations in Kilo-owned packages/ files, and new core-internal imports from the base and head coreImports lists. The migration progress comment job checks out the merge commit with depth 2 and uses HEAD^1 for the base map and the diff.

The generator stays mechanical: git plumbing, path rules, regex and string equality, no dates, code-unit sort.

User Impact

  • Agents close patch cells from rung 1 and rung 2 code with // kilo_port(<feature>:<id>), without a dispositions.json workaround.
  • bun script/upstream/progress.ts --list <feature> prints patch:<feature>:<hash>. The hash is the same as before.
  • Every PR comment shows where new Kilo code landed and whether the ratchets moved.
  • progress.svg is 24 px taller (legend row).

Evidence

The rename alone changes no cell state. progress.json before and after the rename step, with "hook" mapped to "patch" in the old file: identical (diff prints nothing), done list identical, --compare old new prints "No change to the progress map."

progress.json summary Before (origin/host-strategy) After
Cells done 12 / 9854 (0.1%), 0 dropped 12 / 9854 (0.1%), 0 dropped
module 9 / 3557 9 / 3557
api 0 / 39 0 / 39
hook, now patch 0 / 3459 0 / 3459
test 3 / 2799 3 / 2799

Ratchets on v2 (after the Kilo host, #15232): 4 core-internal imports (@opencode/core/bus and @opencode/core/variant from packages/core/src/kilocode/gateway.ts, @opencode/core/app and @opencode/core/plugin/sdk from packages/kilo-cli/src); 15 shared patches by rung: 14 seam, 1 patch. Landed: 0 plugin, 0 host, 0 seam, 0 patch. bun script/upstream/placement.ts --imports (from #15232) reports the same 4 modules.

Done-proofs with temporary edits (all reverted):

  • // kilo_port(gateway:0468bd6d3d9e) in packages/core/src/kilocode/gateway.ts: the cell left --list gateway (75 to 74 open cells), gateway went from 12/87 to 13/87, 1 plugin shows in the README row, the summary and the legend, --compare lists the closed cell, and the placement line reads "1 new kilo_port annotation".
  • Wrong hash (gateway:0468bd6d3d9f) and wrong feature (sandbox:0468bd6d3d9e): the run fails with done-proofs name cells that do not exist on the v1 target.
  • kilo_port in a shared file (packages/core/src/plugin/provider.ts): the run fails with done-proofs in the wrong kind of file.
  • kilocode_change(gateway:0468bd6d3d9e) on the marked line in provider.ts (rung 3): the cell lands at 1 seam, and the placement line reads "1 new marked line in shared files (1 seam)". With both proofs present, the cell is reported once, at seam.
  • export type { Model } from "@opencode/schema/model" in packages/kilo-gateway-core/src/defaults.ts: the run fails with logic packages (packages/kilo-*-core) must import nothing from @opencode/*.

Commands:

  • bun script/upstream/progress.ts twice: identical output (diff -r empty), also under LC_ALL=tr_TR.UTF-8 TZ=Pacific/Kiritimati.
  • bun script/upstream/progress.ts --check: up to date, also after the commit.
  • script/upstream: bun test 82 pass, 0 fail (new tests for kilo_port parsing, landed-rung attribution and the single report, the import count and logic-package rule, and the placement line); bun run typecheck clean.
  • bun script/check-workflows.ts, bun script/check-shared-patches.ts, bun script/check-opencode-annotations.ts: ok.
  • bun run check (root): lint has 0 errors. Typecheck fails locally only on Node built-in typings (zstdCompressSync, node:sqlite, registerHooks) in packages that this PR does not change (no file under packages/ changes); check is green on v2 for the same packages/ tree, and the CI typecheck job passes on this PR.

PR comment on this PR (comment), from the migration progress comment job with the new placement and ratchet lines. The base map predates the ratchets, so this first comment shows n/a for the base values:

Placement: 0 new marked lines in shared files, 0 new kilo_port annotations, core-internal imports not compared (the base map has no import list).

Ratchets: 2 core-internal imports (base n/a); shared patches by rung 13 seam, 1 patch (base n/a).

CI: all checks pass (workflow allowlist, shared upstream patches, migration progress map, migration progress comment, upstream sync tooling tests, typecheck, unit linux and windows).

Shared upstream files changed: none. All changed files are Kilo-owned (script/upstream/**, migration-tracking/**, .kilo/**, .github/workflows/kilo-v2.yml). Progress map delta: none, 12/9854 before and after.

Limits: the placement line describes one diff; in an upstream sync PR it also counts upstream lines that land inside existing Kilo blocks. Mirrored files are not in the ratchets yet. Section 8 says that cell IDs do not change: the hash does not, and the hook: to patch: prefix is the only ID change.

Follow-ups: progress.ts and placement.ts --imports now scan imports with two implementations that agree today; progress.ts should reuse placement.ts. The history table reads every first-parent commit of the local branch, so a branch with two commits that change progress.json gets a history row that CI (which checks the merge ref) does not have. This branch has such a commit, so the committed map is generated as CI sees it, and a local --check on this branch reports README.md and history.svg as stale until the merge.

Rename the cell kind hook to patch, add the kilo_port done-proof for Kilo-owned files, record the landed rung of each proved cell, add the core-internal import and shared-patch ratchets, and add the placement line to the PR comment.
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

➖ v2 migration progress: 0.1% → 0.1% (0 done, 0 total, 0 dropped; 12/9854 cells)

Placement: 0 new marked lines in shared files, 0 new kilo_port annotations, core-internal imports not compared (the base map has no import list).

Ratchets: 4 core-internal imports (base n/a); shared patches by rung 14 seam, 1 patch (base n/a).

No change to the progress map.

v2 migration progress map at this commit

Full map · how cells close

@kilo-code-bot

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

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review at 360b865f19 (previous review at e58136c5f5). The delta is one fix commit plus documentation alignment, all in Kilo-owned paths:

  • script/upstream/progress.ts:290 — the import scan now treats an unreadable (deleted) tracked file as empty. This matches git grep, which also skips deleted working-tree files, and matches the existing .catch(() => "") reads used by --compare and the output check. No logic-package violation is hidden, because a deleted file is likewise absent from the git grep proof scan.
  • script/upstream/progress.ts:827, migration-tracking/progress/README.md:315 — "non-test file of a logic package" now matches the !isTestPath(f) filter on the adapters list in collect.
  • script/upstream/README.md:107 — "done-proofs that no longer resolve fail the run" matches the unknown throw at progress.ts:378.

No shared upstream files changed; no inline comments.

Files Reviewed (3 files)
  • migration-tracking/progress/README.md
  • script/upstream/README.md
  • script/upstream/progress.ts
Previous Review Summary (commit e58136c)

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

Previous review (commit e58136c)

Status: No Issues Found | Recommendation: Merge

Reviewed the full PR at head e58136c5f5: all changed paths are Kilo-owned (script/upstream/**, migration-tracking/**, .kilo/**, .github/workflows/kilo-v2.yml), so no shared-file/plugin-first concerns apply. The core logic in script/upstream/progress.ts (done-proof parsing and rung attribution, proofByCell, scanImports, placement, compare) and its tests were verified line by line against utils/owned.ts, utils/shared.ts, and utils/baseline.ts; the committed progress.json/README.md/progress.svg output matches the generator's shape and the shared-patches.json counts (13 seam, 1 patch). fetch-depth: 2 plus HEAD^1 in the migration progress comment job correctly resolves the base map and PR diff for same-repository pull_request runs.

Notes (not defects): the --compare "hook"→"patch" shim is applied to both snapshots but is inert for current-format files and no feature is named hook; summary.landed counts only non-excluded boxes while the top-level landed map includes excluded cells, which is consistent with the existing done/kinds accounting.

Files Reviewed (10 files)
  • .github/workflows/kilo-v2.yml
  • .kilo/skills/v2-feature-placement/SKILL.md
  • .kilo/skills/v2-migration/SKILL.md
  • migration-tracking/progress/README.md
  • migration-tracking/progress/history.svg
  • migration-tracking/progress/progress.json
  • migration-tracking/progress/progress.svg
  • script/upstream/README.md
  • script/upstream/progress.test.ts
  • script/upstream/progress.ts

Reviewed by deepseek-v4.1-flash-1017 · Input: 36.6K · Output: 10.1K · Cached: 283.8K

Review guidance: REVIEW.md from base branch v2

Base automatically changed from host-strategy to v2 October 19, 2026 09:06
A tracked Kilo-owned file deleted from the working tree crashed the run. Also state that the logic-package rule checks non-test files, and that a re-pin must update done-proofs.
# Conflicts:
#	.kilo/skills/v2-feature-placement/SKILL.md
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