feat(cli): add consistent JSON output to project mutations - #2218
feat(cli): add consistent JSON output to project mutations#2218notgitika wants to merge 2 commits into
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice, well-scoped refactor. The new ProjectMutationResult contract via src/handlers/project/output.ts is consistent across create, add *, and remove *, and the addProjectResource helper in src/handlers/project/add/shared.ts cleanly collapses the duplicated for await loops. A few small observations, none blocking:
parentForinadd/shared.tsand the ternary chain inremove/index.ts(lines 135–142) encode the same parent-relationship knowledge in two places. If a third resource ever gains a parent, both must be updated. Consider extracting a singleparentFor(resourceType, flags)helper shared by both sides — optional cleanup, not required now.addProjectResourcehard-codesinteractive: falseforrunWithProgress. That preserves byte-for-byte behavior of the previousfor awaitloop, which is what the comment says is intended, so this is fine — just worth noting if you later wantaddcommands to get the same live TaskList UI ascreate/deploy.removealways emitsremovedEnvironmentKeys(including[]when nothing was removed), whileadd/createnever emit it. The contract is unambiguous, but you may want to document that shape somewhere consumer-facing (schema/docs) so tools can rely on it.
The tests use real temp-dir projects and go through run(...) end-to-end — no excessive mocking. The router showGlobalOptions: true change is small, covered by a new test, and orthogonal but reasonable to bundle here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2218 +/- ##
============================================
+ Coverage 97.04% 97.05% +0.01%
============================================
Files 544 546 +2
Lines 37536 37669 +133
============================================
+ Hits 36428 36561 +133
Misses 1108 1108 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Claude Security Review: no high-confidence findings. (run) |
Uses the existing global
JsonKey/JsonRendererKeypath with a shared project mutation envelope for create, add, and remove. All project add leaves now use onerunWithProgresswrapper, and nested help shows inherited global options.Human-readable output remains unchanged.