fix(kiro-ide): ship only IDE-native agent and settings surfaces (#555) - #653
fix(kiro-ide): ship only IDE-native agent and settings surfaces (#555)#653wowzoo wants to merge 4 commits into
Conversation
…abs#555) Kiro IDE does not read Kiro CLI's agent-v1 JSON configs or settings/cli.json, yet harness/kiro-ide shipped both. The IDE resolved no conductor from them and `--doctor` failed a check for a CLI-only file the IDE never uses. §1 (agents — the IDE reads Markdown, not JSON): - harness/kiro-ide: drop the 15 agent JSONs (14 personas + aidlc.json); ship the conductor as an authored agents/aidlc.md (IDE selector entry). - Each delegation-target .md gets a `tools:` grant + a `permissions.rules` block (IDE 1.0 capability/effect/match model) and drops the CLI-only `disallowedTools` field, via the manifest's frontmatterAdditions + new frontmatterRemovals. - Core, additive: aidlc-lib.ts loadAgents excludes aidlc.md from the domain roster; aidlc-utility.ts doctor accepts agents/aidlc.{json,md} and gates the settings/cli.json row on a CLI install (aidlc.json present) — the two fixes the issue names. §2 (settings/cli.json — CLI activation only): dropped from the IDE tree. §3 (docs parity): - onboarding.fills agents_note rewritten to the IDE reality (agent .md only, aidlc.md selector, no JSON/cli.json). - docs/reference/14-claude-features.md primitive-map: the IDE's standing-rules cell now names the seeded workspace shell, not the agent resources glob that no longer exists on this harness. - docs/guide/harnesses/kiro-ide.md: the Install list, the dispatch row, and the framework-developers section no longer describe cli.json or agent-v1 JSONs as shipped. The delegate-scoping note now points at permissions.rules instead of calling the grant unscoped. Adapter and hook prose left untouched (awslabs#615 owns the stdin channel). - t239 read harness/kiro-ide/agents/aidlc.json and asserted a resources glob; it now asserts the authored aidlc.md carries no resources: key and that aidlc.json is absent, in lockstep with the primitive-map cell. - tests/fixtures/docs-legacy-refs.json: one t174 pin refreshed to the edited primitive-map line (the new line still carries the pinned token). Seam (scripts, additive — other harnesses byte-identical): - manifest-types.ts: new frontmatterRemovals field. - package.ts: applyFrontmatterRemovals + buildTree wiring; the additions loop now skips indented continuation lines (multi-line block support). Tests updated for the new shape: harness-matrix (kiro-ide kiroAgentJson=false, memoryInclude="kiro-ide-workspace"), t148, t157, t220, t-active-space-includes. Verified: bun scripts/package.ts --check OK on all 5 harnesses; bun run check green (parity + typecheck + lint); doctor 37/0; t68/t174/t239 19/0. The full default tier reports t66 and t89 failing — both reproduce unchanged on base 257b43a (2.5.11 added the claim-sources sensor without refreshing the designer-export golden fixture or the sensor-import fixture dir), so they are not from this change.
leandrodamascena
left a comment
There was a problem hiding this comment.
Thanks for addressing the Kiro IDE/CLI mismatch and for the detailed validation work. The overall direction makes sense, particularly moving to native Markdown agents and removing configuration that the IDE does not use. I found a few implementation details that introduce risks around active-space memory, plugin delegation, and shell permissions. These need to be addressed before merging to avoid breaking existing behavior.
[P1] Active-space memory no longer follows space switches
The PR removes the Kiro-native memory include and changes the active-space test to expect repointHarnessIncludes() to do nothing. Since compiled rules_in_context remains pinned to aidlc/spaces/default/memory/, switching spaces may continue using default-space rules.
We need to retain an IDE-native include under .kiro/steering/ or resolve these paths dynamically.
[P1] Plugin-dispatched stages become undispatchable
The plugin composer still treats every .kiro harness as Kiro CLI and requires agent JSON plus trustedAgents registration. After this PR removes those files, Kiro IDE plugin stages using delegated agents or reviewers are rejected even when their Markdown agents exist.
Plugin validation and tests need to distinguish Kiro CLI from Kiro IDE.
[P1] bun * is broader than the engine requires
The new rule pre-approves every Bun command, including bun -e and arbitrary workspace scripts. These commands can also modify files outside the filesystem paths listed in the profile.
This should be restricted to the specific AI-DLC commands needed by the conductor and delegates.
[P2] Filesystem rules are autoapprovals, not strict scopes
Kiro defaults unmatched operations to ask, not deny. Therefore aidlc/spaces/** controls which operations avoid consent but does not prevent writes elsewhere. Documentation and tests describing this as enforcement or sandboxing should be corrected.
[P2] Frontmatter transformations need stronger validation
The generic transformation can produce invalid YAML around comments or blank lines in removed mappings. Additions can also contain duplicate top-level keys without failing. This seam needs focused tests and fail-closed validation.
Before merging, this needs:
- Active-space memory loading preserved for Kiro IDE.
- Kiro CLI and IDE distinguished during plugin validation.
- Narrow shell permission patterns instead of
bun *. - Kiro IDE plugin delegation and non-default-space coverage.
I verified head 474d5a4a. Package parity and the focused suites pass, but these paths are not currently covered.
…ugin validation (awslabs#555) Review feedback on the five points raised. Four are implemented; the fifth (active-space memory) is answered in the PR thread rather than changed, because the premise does not hold — details below. [P1] `bun *` narrowed to the engine's real command surface - personaFrontmatter and the authored conductor agents/aidlc.md now grant `bun {{HARNESS_DIR}}/tools/aidlc-*` instead of `bun *`. That is the glob equivalent of the CLI JSON's `bun \.kiro/tools/.*` regex, and it covers every command the conductor prose issues (orchestrate, state, log, utility, learnings, graph, swarm, worktree). `bun -e <code>` and arbitrary workspace scripts are no longer pre-approved. [P1] Plugin validation distinguishes Kiro CLI from Kiro IDE - kiroPluginAgentPrechecks keyed on HARNESS_LEAF === ".kiro", so an IDE install was checked for an agent-v1 JSON + trustedAgents surface it does not ship. The conductor's shape is the discriminator: `agents/aidlc.json` present = CLI. On an IDE install the precheck now no-ops, as it already did on Claude Code. missingTrust keys off the same flag. [P2] Filesystem rules documented as autoapprovals, not sandboxes - Kiro defaults an unmatched operation to `ask`, so these lists decide what proceeds without consent, not where a delegate may write. Corrected in the manifest comments, the t148 assertion prose, and the Kiro IDE guide. [P2] Frontmatter seam hardened, with focused tests - applyFrontmatterRemovals treated a blank line or a full-line comment inside the removed block as a terminator, leaving the rest of that key's indented values behind as orphans — invalid YAML. Only a real top-level mapping key ends the block now; a non-indented non-key line and any surviving orphan both fail closed. applyFrontmatterAdditions also rejects a key declared twice within one addition block (previously only core collisions were checked). - Both functions moved to scripts/manifest-types.ts, beside the contract they serve: package.ts runs its build at import time, so a test cannot reach into it for a function. New t249 covers 14 cases including the two defects. [P1] Active-space memory — answered, not changed - `resources:` is a Kiro CLI agent-v1 key. The IDE agent schema is name/description/tools/model/mcpServers/permissions; it does not read `resources`, so the memory glob the JSON carried was inert on the IDE even while the JSON shipped. Dropping it changed nothing an IDE session observes. - `rules_in_context` being default-pinned is the documented stock design (aidlc-graph.ts, the COMPILE/DISPLAY vs PROJECT family note): it is a list of display paths frozen at package time, and the active-space cursor governs the PROJECT family (memoryDirFor writers, the templates sensor) which this PR does not touch. The t157 and t-active-space-includes comments are corrected to say this precisely instead of claiming the IDE auto-reads the workspace shell. New coverage: t249 (frontmatter seam, 14 tests) and a Kiro IDE plugin-dispatch case in t188 — the same synthetic ensemble stage as the CLI case, asserted to compose rather than drop. Both fail without their fix (verified by reverting). Verified: bun run check green (parity 5 harnesses + typecheck + lint, 524 files); bun tests/run-tests.ts --smoke --unit 178 files / 0 failed / 4401 assertions; t188 61/0; doctor 37/0 and compile --check clean on a seeded IDE tree. Live Kiro IDE 1.0.212, three runs on the narrowed grant: initialization through intent-capture and scope-definition, zero ERROR_LOGGED and zero permission/denied traces, 20 SENSOR_FIRED / 20 SENSOR_PASSED, and hook targets firing throughout (runtime-compile 50, state-sync 50, block 45). The third run dispatched the composer, which authored a custom scope into `.kiro/scopes/` and the scope grid — so the narrowed grant is proven on a delegated session, not only the conductor's. The visual-mockups plugin was installed for two of the runs: no plugin-compose drops, no duplicated contribution blocks.
|
Thanks — four of the five are implemented in [P1]
|
leandrodamascena
left a comment
There was a problem hiding this comment.
The fixes raised in the previous review have been addressed, but one blocking gap remains in the Kiro IDE plugin-agent path.
scripts/plugin-hooks-template/compose.ts:634-639 disables plugin-agent dispatch validation for Kiro IDE. The test at tests/integration/t188-plugin-compose.test.ts:640-681 accepts a dispatched plugin stage whose agent contains no tools or permissions, and compose.ts:1188-1199 copies that agent without the projection applied to core IDE agents.
The test confirms file composition, but not that the resulting agent is dispatchable. This also conflicts with docs/reference/18-plugin-mechanism.md:291-300.
Please either project and validate plugin agents as Kiro IDE-native agents, or reject plugin-dispatched stages until that support exists. The test should verify the resulting dispatch surface, not only file existence.
Additional documentation corrections:
README.md:131still references the removed.kiro/settings/cli.json.CHANGELOG.md:9describes the shell permission asbun *, while the implementation usesbun .kiro/tools/aidlc-*.
…jection exists Review follow-up on awslabs#653. The previous revision keyed the plugin dispatch precheck on the conductor's shape and no-op'd it on Kiro IDE, on the premise that "a Markdown persona is present, so the stage is dispatchable". That premise is wrong: IDE 1.0 delegation needs a `tools:` grant AND a `permissions.rules` block on the target agent (harness/kiro-ide/manifest.ts:71-72 appends both to every core persona). A plugin agent ships neither, and compose applies no IDE projection when it copies one — unlike `.aidlc`, where projectOpencodeAgentMemory rewrites the native twin. Composing it verbatim yielded an agent that dispatches but can neither read, write, nor run anything: a silent capability hole, and a state docs/reference/18-plugin-mechanism.md never described. Deciding which grants to inject is the packager's job (frontmatterAdditions), not the composer's, so this takes the documented path for every other harness whose dispatch surface a plugin cannot ship: reject the stage and drop-log it. Inline plugin stages are unaffected on the IDE, as on every other harness. - compose.ts: the IDE surface is the agent's grants, not the file's existence. New installedIdeAgentIsDispatchable() checks `tools:` + `permissions:` in the installed agent `.md`; a missing file gets the same verdict. Remediation text branches for the IDE so it stops advising the CLI's agent-v1 JSON remedy. - t188: the IDE case now asserts the RESULTING DISPATCH SURFACE rather than file existence — stage rejected, drops name the agent and `permissions.rules`, and the drop must NOT carry the CLI remedy. Added a contrast assertion that a core persona IS dispatchable on the same harness, so the test pins "the verdict tracks the surface, not the harness leaf". Counter-verified: reverting the compose change fails exactly this test (60 pass / 1 fail). - 18-plugin-mechanism.md: document the IDE rule and why compose cannot satisfy it today, so code and docs agree. Documentation corrections raised in the same review: - README.md:131 referenced `.kiro/settings/cli.json`, which this PR removes from the IDE distribution. Now states the IDE activates from the workspace agent selector and that the file stays in `dist/kiro/`. - CHANGELOG.md:9 described the shell grant as `bun *` while the implementation narrowed it to `bun .kiro/tools/aidlc-*` in the previous revision — the CHANGELOG was not updated alongside it. Verification: `bun run check` green (parity 5 harnesses + typecheck + lint, 524 files) · `bun tests/run-tests.ts --smoke --unit` 178 files / 0 failed / 4401 assertions · t188 61/0. dist/plugins/*/hooks/compose.ts regenerated (the template projects to all five harnesses).
|
Addressed in Plugin-agent dispatch on Kiro IDE — reject The IDE's dispatch surface is not file existence but the grant: IDE 1.0 delegation needs
Documentation corrections — Verified on |
|
Thanks, Keehyun. The core finding in #555 is still valid: current I reviewed latest head Since this branch was last synchronized, #658 added the always-included, Please do not spend time rebasing this branch. Maintainers can port the |
Fixes §1, §2, and §3 of #555. §4 (hook schema) was resolved by #614, so it is
out of scope here; the adapter's stdin channel belongs to #615 and I left its
prose and code untouched.
What this changes
Kiro IDE does not read Kiro CLI's agent-v1 JSON configs or
settings/cli.json,yet
harness/kiro-ide/shipped both. On an IDE install the JSONs were deadweight, and
--doctorfailed a check for a CLI-only file the IDE never uses.§1 — agents ship as Markdown. Dropped the 15 agent JSONs (14 personas +
aidlc.json) and added the conductor as an authoredagents/aidlc.md, so itappears in the IDE's workspace agent selector. Each delegation-target
.mdnowcarries a
permissions.rulesblock (the IDE 1.0 capability/effect/match model)alongside its existing
tools:grant, and no longer carriesdisallowedTools— a Claude Code field the IDE does not recognize.
§2 —
settings/cli.jsondropped from the IDE tree.§3 — docs parity.
onboarding.fillsagents_note, the14-claude-features.mdprimitive-map, andkiro-ide.mdno longer describecli.json or agent-v1 JSONs as shipped.
The two core fixes the issue names
#555 §1 spells these out, and both are additive — a CLI tree is byte-identical
either way:
aidlc-utility.tshandleDoctor: acceptsagents/aidlc.{json,md}, and runsthe
settings/cli.jsonrow only on a CLI install (aidlc.jsonpresent).aidlc-lib.tsloadAgents: excludesaidlc.mdfrom the domain-agent roster,so the conductor does not fail agent-schema validation or pollute
knownAgents.Packager seam
Two additive changes in
scripts/, both no-ops for every other harness:manifest-types.ts: new optionalfrontmatterRemovalsfield.package.ts:applyFrontmatterRemovals, plus the additions loop now skipsindented continuation lines so a multi-line block like
permissions.rulescan be injected.
bun scripts/package.ts --checkreports OK on all five harnesses — the fournon-kiro-ide trees are unchanged byte-for-byte.
Tests
Updated for the new shape:
harness-matrix(kiro-idekiroAgentJson: false,new
memoryInclude: "kiro-ide-workspace"union value),t148,t157,t220,t-active-space-includes, andt239.t239previously readharness/kiro-ide/agents/aidlc.jsonand asserted a resources glob; it nowasserts the authored
aidlc.mdcarries noresources:key and thataidlc.jsonis absent, in lockstep with the primitive-map cell it guards. Onet174pin was refreshed to the edited primitive-map line.Verification
bun run check— green (parity + typecheck + biome, 523 files)bun tests/run-tests.ts --smoke --unit— 177 files, 0 failed, 4387 assertionsbun scripts/ci-changelog-guard.ts <base>— OK, 137 entries preserved, 1 new/aidlc --doctoron a seeded IDE tree — 37/0The full default tier also reports
t66andt89failing. Both reproduceunchanged on base
257b43a3: 2.5.11 added theclaim-sourcessensor withoutrefreshing the designer-export golden fixture or the sensor-import fixture dir.
They are not from this change, and both live in the integration tier the PR gate
excludes. I can file that separately if useful.
Version bumped to 2.5.13 (2.5.12 is taken by #615) with a matching CHANGELOG
entry and README badge.