diff --git a/.changeset/atomic-capability-chaining.md b/.changeset/atomic-capability-chaining.md deleted file mode 100644 index b48adad7..00000000 --- a/.changeset/atomic-capability-chaining.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@ghx-dev/core": minor ---- - -Add atomic capability chaining: `executeTasks()` function that executes multiple capabilities in a single GraphQL batch with ≤2 API round-trips. New `ghx chain --steps ''` CLI command. Supersedes the unused composite capability system which has been removed. - diff --git a/.changeset/benchmark-overhaul-capability-naming.md b/.changeset/benchmark-overhaul-capability-naming.md deleted file mode 100644 index afdd6d10..00000000 --- a/.changeset/benchmark-overhaul-capability-naming.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -"@ghx-dev/core": minor ---- - -### Capability naming overhaul - -Renamed all capabilities to follow a consistent `domain.resource.action` pattern. Key renames include: -- `pr.comments.list` → `pr.thread.list`, `pr.comment.reply` → `pr.thread.reply`, `pr.comment.resolve` → `pr.thread.resolve`, `pr.comment.unresolve` → `pr.thread.unresolve` -- `pr.mergeability.view` → `pr.merge.status`, `pr.merge.execute` → `pr.merge` -- `pr.status.checks` → `pr.checks.list`, `pr.checks.get_failed` → `pr.checks.failed` -- `pr.reviews.list` → `pr.review.list`, `pr.reviewers.request` → `pr.review.request` -- `pr.review.submit_approve`/`submit_comment`/`submit_request_changes` → unified `pr.review.submit` with `event` parameter -- `pr.diff.list_files` → `pr.diff.files`, `pr.ready_for_review.set` → removed (replaced by `pr.update`) -- `workflow_run.get` → `workflow.run.view`, `workflow_runs.list` → `workflow.runs.list`, `workflow_run.*` → `workflow.run.*` -- `workflow_job.logs.get` → `workflow.job.logs.raw`, `workflow_job.logs.analyze` → `workflow.job.logs.get` -- Removed redundant `workflow.run.jobs.list` capability - -### New capabilities - -- `pr.diff.view` — view PR diff content -- `issue.labels.add` — add labels to an issue (non-destructive; complements `issue.labels.update`) -- `pr.create` — create a pull request -- `pr.update` — update PR title/body/base -- `workflow.run.view` (renamed from `workflow_run.get`) — now includes GraphQL routing - -### GraphQL improvements - -- Extracted 3 shared GraphQL fragments (`PageInfoFields`, `IssueCoreFields`, `PrCoreFields`) reducing field duplication across 10 operation files -- Routed `pr.merge.status` and `repo.view` through GraphQL (preferred) with CLI fallback -- Added `fetchPrMergeStatus` to the GraphQL client - -### Capabilities list enrichment - -- `capabilities list` now returns `required_inputs` per capability — agents can skip `explain` calls -- `--domain` filter for `ghx capabilities list` (e.g., `--domain pr`) -- Slimmed SKILL.md to reference `required_inputs` in list output - -### stdin input support - -- `ghx run --input -` reads JSON input from stdin with 10s timeout - -### Integration tests - -- 58 new integration tests covering all previously untested capabilities diff --git a/.changeset/capability-list-optional-inputs.md b/.changeset/capability-list-optional-inputs.md deleted file mode 100644 index 9496ba28..00000000 --- a/.changeset/capability-list-optional-inputs.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@ghx-dev/core": minor ---- - -Add `optional_inputs` and `optional_inputs_detail` fields to `CapabilityListItem` for richer capability introspection. Also adds a required `optional_inputs` field to the exported `CapabilityExplanation` type — downstream consumers must handle this new field. diff --git a/.changeset/capability-namespace-standardization.md b/.changeset/capability-namespace-standardization.md deleted file mode 100644 index 7dffeee7..00000000 --- a/.changeset/capability-namespace-standardization.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -"@ghx-dev/core": minor ---- - -Standardize all capability IDs to consistent naming conventions. - -**Renamed capabilities:** - -- `pr.thread.*` → `pr.threads.*` (list, reply, resolve, unresolve) -- `pr.review.*` → `pr.reviews.*` (list, request, submit) -- `pr.checks.rerun_all` → `pr.checks.rerun.all` -- `pr.checks.rerun_failed` → `pr.checks.rerun.failed` -- `workflow.get` → `workflow.view` -- `workflow.dispatch.run` → `workflow.dispatch` -- `workflow.run.rerun_all` → `workflow.run.rerun.all` -- `workflow.run.rerun_failed` → `workflow.run.rerun.failed` -- `workflow.job.logs.get` → `workflow.job.logs.view` -- `project_v2.org.get` → `project_v2.org.view` -- `project_v2.user.get` → `project_v2.user.view` -- `project_v2.item.add_issue` → `project_v2.items.issue.add` -- `project_v2.item.field.update` → `project_v2.items.field.update` -- `release.get` → `release.view` -- `release.create_draft` → `release.create` -- `release.publish_draft` → `release.publish` -- `issue.labels.update` → `issue.labels.set` -- `issue.assignees.update` → `issue.assignees.set` -- `issue.relations.get` → `issue.relations.view` -- `issue.linked_prs.list` → `issue.relations.prs.list` -- `issue.parent.set` → `issue.relations.parent.set` -- `issue.parent.remove` → `issue.relations.parent.remove` -- `issue.blocked_by.add` → `issue.relations.blocked_by.add` -- `issue.blocked_by.remove` → `issue.relations.blocked_by.remove` - -**New capabilities:** - -- `issue.labels.remove` — remove specific labels from an issue -- `issue.assignees.add` — add assignees without replacing existing -- `issue.assignees.remove` — remove specific assignees -- `issue.milestone.clear` — remove milestone from an issue -- `pr.assignees.add` — add assignees to a PR -- `pr.assignees.remove` — remove assignees from a PR -- `project_v2.items.issue.remove` — remove an issue from a Projects v2 project - -**Retired capabilities:** - -- `pr.checks.failed` — merged into `pr.checks.list` (use `state: "failed"` filter) -- `check_run.annotations.list` — annotations now inline in `pr.checks.list` output -- `pr.assignees.update` — replaced by `pr.assignees.add` + `pr.assignees.remove` -- `pr.threads.composite`, `issue.triage.composite`, `issue.update.composite` — composite infrastructure removed - -**Output schema changes:** - -- All rerun capabilities now return `{ runId: integer, queued: boolean }` (normalized) -- `pr.threads.reply` output now includes `commentId` and `commentUrl` -- `issue.relations.parent.set` output now includes `updated: boolean` -- `issue.relations.blocked_by.add` output now includes `added: boolean` -- `issue.milestone.set` no longer accepts `null` (use `issue.milestone.clear` instead) diff --git a/.changeset/claude-plugin-infrastructure.md b/.changeset/claude-plugin-infrastructure.md deleted file mode 100644 index 5ba9f0a7..00000000 --- a/.changeset/claude-plugin-infrastructure.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@ghx-dev/core": minor ---- - -Add Claude Code plugin infrastructure for native plugin installation. - -- Move skill to `skills/using-ghx/SKILL.md` with plugin frontmatter, serving both `ghx setup` and Claude Code plugin -- Add `.claude-plugin/plugin.json` (package) and `.claude-plugin/marketplace.json` (repo root) -- Add `sync-plugin-manifests.mjs` to generate plugin manifests from `package.json` with `--check` mode for CI -- Remove redundant `dist/skills` copy (skills ship via `files` array at package root) diff --git a/.changeset/dissolve-agent-interface.md b/.changeset/dissolve-agent-interface.md deleted file mode 100644 index 5398b814..00000000 --- a/.changeset/dissolve-agent-interface.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@ghx-dev/core": minor ---- - -Remove `@ghx-dev/core/agent` subpath export. All agent tools (`createExecuteTool`, `explainCapability`, `listCapabilities`) are now exported from `@ghx-dev/core`. The `MAIN_SKILL_TEXT` constant has been removed. diff --git a/.changeset/fix-pr-review-followups.md b/.changeset/fix-pr-review-followups.md deleted file mode 100644 index 3b42d011..00000000 --- a/.changeset/fix-pr-review-followups.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -"@ghx-dev/core": patch ---- - -Refactor CLI capability adapter into domain modules with full unit test coverage. - -**Refactoring:** - -- Split monolithic `cli-capability-adapter.ts` (2200+ lines) into focused domain modules under `core/execution/adapters/cli/domains/`: `repo.ts`, `issue.ts`, `pr.ts`, `workflow.ts`, `project-v2.ts`, `release.ts` -- Extracted shared arg-building helpers to `cli/helpers.ts` (`buildRepoArg`, `buildPaginationArgs`, `buildFieldsFlag`, etc.) -- Added `cli/capability-registry.ts` — auto-discovers all handlers by spreading domain `handlers` maps; `cli-capability-adapter.ts` becomes a thin dispatcher - -**Bug fixes:** - -- `pr.ts`: Use `rerunAllResult.exitCode` (not `result.exitCode`) in `handlePrChecksRerunFailed` fallback error path -- `project-v2.ts`: Remove unreachable `SyntaxError` catch branch in `handleProjectV2ItemFieldUpdate` (no JSON parsing on the success path) -- `release.ts`: Fix misleading error message — `owner`/`name` are already validated by `requireRepo`; only `releaseId` can be invalid at that point -- `workflow.ts`: Track total error/warning counts independently of the 10-line collection cap in `handleWorkflowJobLogsGet`; type-narrow artifact `id` field consistently with other normalized fields - -**Tests:** - -- Added comprehensive unit test suites for all six domain modules (`cli-domains-*.test.ts`) and for the shared helpers (`cli-helpers.test.ts`) and capability registry (`cli-capability-registry.test.ts`) — all modified files at ≥90% branch coverage -- Refactored e2e tests to use proper `afterEach`/`afterAll` lifecycle hooks instead of ESLint rule suppressions - -**Docs:** - -- Updated `docs/architecture/adapters.md` and `docs/architecture/repository-structure.md` to reflect the new domain module layout diff --git a/.changeset/ghx-chain-batch-aliasing-fix.md b/.changeset/ghx-chain-batch-aliasing-fix.md deleted file mode 100644 index 478c7d82..00000000 --- a/.changeset/ghx-chain-batch-aliasing-fix.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@ghx-dev/core": patch ---- - -Fix `ghx chain` / `executeTasks` batch resolution aliasing bug. - -`buildBatchQuery` aliases each GraphQL root field (e.g. `repository`) as `step0`, `step1`, etc. GitHub returns the value directly under the alias key with no wrapper. The engine was storing the unwrapped value, causing `applyInject` to fail when traversing inject paths like `repository.issue.id` in subsequent steps. - -Fix: `extractRootFieldName()` is added to `batch.ts` and used in the Phase 1 un-alias loop to re-wrap the raw value as `{ [rootFieldName]: rawValue }` before storing it in `lookupResults`. Adds regression test using real batch/resolve implementations. diff --git a/.changeset/gql-lazy-loading-refactor.md b/.changeset/gql-lazy-loading-refactor.md deleted file mode 100644 index e5f8700b..00000000 --- a/.changeset/gql-lazy-loading-refactor.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@ghx-dev/core": patch ---- - -Refactor GQL layer: split monolithic client.ts into lazy-loaded domain modules, add capability registry dispatch, and rename common-types.ts to follow .generated convention. Import cost reduced from ~2,284 lines to ~220 lines via dynamic imports. diff --git a/.changeset/import-aliases.md b/.changeset/import-aliases.md deleted file mode 100644 index 300c6ce6..00000000 --- a/.changeset/import-aliases.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@ghx-dev/core": patch ---- - -Replace deep relative imports with `@core/*` path aliases for improved readability and maintainability. diff --git a/.changeset/issue-mutations-input-standardization.md b/.changeset/issue-mutations-input-standardization.md deleted file mode 100644 index 26c804bc..00000000 --- a/.changeset/issue-mutations-input-standardization.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@ghx-dev/core": minor ---- - -Standardize all issue mutation capabilities to accept `{ owner, name, issueNumber }` instead of `{ issueId }`. - -**Breaking input change** for: `issue.close`, `issue.reopen`, `issue.delete`, `issue.update`, `issue.labels.set`, `issue.labels.add`, `issue.labels.remove`, `issue.assignees.set`, `issue.assignees.add`, `issue.assignees.remove`, `issue.milestone.set`, `issue.comments.create`. - -Each capability now resolves the GitHub node ID internally via a Phase 1 lookup before executing the Phase 2 mutation. This matches the input contract of `issue.view` and enables `ResolutionCache` hits when capabilities are chained together in `executeTasks` calls. diff --git a/.changeset/pr-60-review-fixes.md b/.changeset/pr-60-review-fixes.md deleted file mode 100644 index 8d95549e..00000000 --- a/.changeset/pr-60-review-fixes.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@ghx-dev/core": patch ---- - -Harden atomic chaining infrastructure based on review feedback: - -- Register `issue.assignees.add`/`remove` GraphQL handlers (types, mutations, client, capability registry) — these capabilities now route via GraphQL instead of falling back to CLI -- Fix `GraphqlError.path` type to `ReadonlyArray` per GraphQL spec -- Normalize `queryRaw` error handling — HTTP errors now settle consistently regardless of transport implementation -- Guard resolution cache against storing `undefined` and sweep expired entries before FIFO eviction -- Check `response.ok` before `response.json()` and wrap happy-path parse in try/catch for truncated responses -- Use strict `!== undefined` check for step errors instead of truthy check -- Extract `buildLookupVars` helper to eliminate duplication in engine -- Pass strings directly to `mapErrorToCode` instead of wrapping in `Error` diff --git a/.changeset/pr-reviews-submit-schema-improvements.md b/.changeset/pr-reviews-submit-schema-improvements.md deleted file mode 100644 index 8448a20f..00000000 --- a/.changeset/pr-reviews-submit-schema-improvements.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@ghx-dev/core": patch ---- - -Improve `pr.reviews.submit` schema and capabilities list output. - -- Add `startLine` and `startSide` fields to `pr.reviews.submit` for multi-line comment ranges -- Document the `side` vs `diffSide` naming asymmetry between submit input and `pr.threads.list` output -- Annotate `body` conditionality: required for `COMMENT`/`REQUEST_CHANGES`, optional for `APPROVE` -- Clarify `pr.reviews.list` description to note it returns review-level metadata only (not inline thread comments) -- Show array item field hints in `capabilities list` text output (e.g. `comments?[path, body, line, side?, startLine?, startSide?]`) diff --git a/.changeset/structured-execution-logging.md b/.changeset/structured-execution-logging.md deleted file mode 100644 index c680fccd..00000000 --- a/.changeset/structured-execution-logging.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@ghx-dev/core": minor ---- - -Add structured JSONL execution logging. Emits typed log events at key points in the execution pipeline — preflight checks, route selection, adapter dispatch, all attempt failures (with `retryable` field), and results — written to `~/.ghx/logs/ghx-YYYY-MM-DD.jsonl`. Opt-in via `GHX_LOG_LEVEL` env var (debug/info/warn/error; unset = off). Log directory is configurable via `GHX_LOG_DIR`. diff --git a/packages/benchmark/CHANGELOG.md b/packages/benchmark/CHANGELOG.md index 9948b8a1..bcdf91dc 100644 --- a/packages/benchmark/CHANGELOG.md +++ b/packages/benchmark/CHANGELOG.md @@ -1,5 +1,25 @@ # @ghx-dev/benchmark +## 0.2.2 + +### Patch Changes + +- Updated dependencies [a38e812] +- Updated dependencies [de1c7a1] +- Updated dependencies [bc10ce8] +- Updated dependencies [d3564e2] +- Updated dependencies [0b0335b] +- Updated dependencies [871d369] +- Updated dependencies [fb05c12] +- Updated dependencies [bc10ce8] +- Updated dependencies [c4fbcaa] +- Updated dependencies [89344ca] +- Updated dependencies [bc10ce8] +- Updated dependencies [7225358] +- Updated dependencies [bc10ce8] +- Updated dependencies [58cc7fe] + - @ghx-dev/core@0.2.0 + ## 0.2.1 ### Patch Changes diff --git a/packages/benchmark/package.json b/packages/benchmark/package.json index bf14ad6f..23aa2b0c 100644 --- a/packages/benchmark/package.json +++ b/packages/benchmark/package.json @@ -1,6 +1,6 @@ { "name": "@ghx-dev/benchmark", - "version": "0.2.1", + "version": "0.2.2", "description": "Internal benchmark harness for comparing ghx against agent_direct runs.", "private": true, "author": "Arye Kogan", diff --git a/packages/core/.claude-plugin/plugin.json b/packages/core/.claude-plugin/plugin.json index 6f0021bc..885cc775 100644 --- a/packages/core/.claude-plugin/plugin.json +++ b/packages/core/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "ghx", "description": "GitHub execution router for AI agents — 66 capabilities with deterministic routing and normalized output", - "version": "0.1.2", + "version": "0.2.0", "author": { "name": "Arye Kogan" }, diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 005078a5..36a88605 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,176 @@ # @ghx-dev/core +## 0.2.0 + +### Minor Changes + +- a38e812: Add atomic capability chaining: `executeTasks()` function that executes multiple capabilities in a single GraphQL batch with ≤2 API round-trips. New `ghx chain --steps ''` CLI command. Supersedes the unused composite capability system which has been removed. +- de1c7a1: ### Capability naming overhaul + + Renamed all capabilities to follow a consistent `domain.resource.action` pattern. Key renames include: + + - `pr.comments.list` → `pr.thread.list`, `pr.comment.reply` → `pr.thread.reply`, `pr.comment.resolve` → `pr.thread.resolve`, `pr.comment.unresolve` → `pr.thread.unresolve` + - `pr.mergeability.view` → `pr.merge.status`, `pr.merge.execute` → `pr.merge` + - `pr.status.checks` → `pr.checks.list`, `pr.checks.get_failed` → `pr.checks.failed` + - `pr.reviews.list` → `pr.review.list`, `pr.reviewers.request` → `pr.review.request` + - `pr.review.submit_approve`/`submit_comment`/`submit_request_changes` → unified `pr.review.submit` with `event` parameter + - `pr.diff.list_files` → `pr.diff.files`, `pr.ready_for_review.set` → removed (replaced by `pr.update`) + - `workflow_run.get` → `workflow.run.view`, `workflow_runs.list` → `workflow.runs.list`, `workflow_run.*` → `workflow.run.*` + - `workflow_job.logs.get` → `workflow.job.logs.raw`, `workflow_job.logs.analyze` → `workflow.job.logs.get` + - Removed redundant `workflow.run.jobs.list` capability + + ### New capabilities + + - `pr.diff.view` — view PR diff content + - `issue.labels.add` — add labels to an issue (non-destructive; complements `issue.labels.update`) + - `pr.create` — create a pull request + - `pr.update` — update PR title/body/base + - `workflow.run.view` (renamed from `workflow_run.get`) — now includes GraphQL routing + + ### GraphQL improvements + + - Extracted 3 shared GraphQL fragments (`PageInfoFields`, `IssueCoreFields`, `PrCoreFields`) reducing field duplication across 10 operation files + - Routed `pr.merge.status` and `repo.view` through GraphQL (preferred) with CLI fallback + - Added `fetchPrMergeStatus` to the GraphQL client + + ### Capabilities list enrichment + + - `capabilities list` now returns `required_inputs` per capability — agents can skip `explain` calls + - `--domain` filter for `ghx capabilities list` (e.g., `--domain pr`) + - Slimmed SKILL.md to reference `required_inputs` in list output + + ### stdin input support + + - `ghx run --input -` reads JSON input from stdin with 10s timeout + + ### Integration tests + + - 58 new integration tests covering all previously untested capabilities + +- bc10ce8: Add `optional_inputs` and `optional_inputs_detail` fields to `CapabilityListItem` for richer capability introspection. Also adds a required `optional_inputs` field to the exported `CapabilityExplanation` type — downstream consumers must handle this new field. +- d3564e2: Standardize all capability IDs to consistent naming conventions. + + **Renamed capabilities:** + + - `pr.thread.*` → `pr.threads.*` (list, reply, resolve, unresolve) + - `pr.review.*` → `pr.reviews.*` (list, request, submit) + - `pr.checks.rerun_all` → `pr.checks.rerun.all` + - `pr.checks.rerun_failed` → `pr.checks.rerun.failed` + - `workflow.get` → `workflow.view` + - `workflow.dispatch.run` → `workflow.dispatch` + - `workflow.run.rerun_all` → `workflow.run.rerun.all` + - `workflow.run.rerun_failed` → `workflow.run.rerun.failed` + - `workflow.job.logs.get` → `workflow.job.logs.view` + - `project_v2.org.get` → `project_v2.org.view` + - `project_v2.user.get` → `project_v2.user.view` + - `project_v2.item.add_issue` → `project_v2.items.issue.add` + - `project_v2.item.field.update` → `project_v2.items.field.update` + - `release.get` → `release.view` + - `release.create_draft` → `release.create` + - `release.publish_draft` → `release.publish` + - `issue.labels.update` → `issue.labels.set` + - `issue.assignees.update` → `issue.assignees.set` + - `issue.relations.get` → `issue.relations.view` + - `issue.linked_prs.list` → `issue.relations.prs.list` + - `issue.parent.set` → `issue.relations.parent.set` + - `issue.parent.remove` → `issue.relations.parent.remove` + - `issue.blocked_by.add` → `issue.relations.blocked_by.add` + - `issue.blocked_by.remove` → `issue.relations.blocked_by.remove` + + **New capabilities:** + + - `issue.labels.remove` — remove specific labels from an issue + - `issue.assignees.add` — add assignees without replacing existing + - `issue.assignees.remove` — remove specific assignees + - `issue.milestone.clear` — remove milestone from an issue + - `pr.assignees.add` — add assignees to a PR + - `pr.assignees.remove` — remove assignees from a PR + - `project_v2.items.issue.remove` — remove an issue from a Projects v2 project + + **Retired capabilities:** + + - `pr.checks.failed` — merged into `pr.checks.list` (use `state: "failed"` filter) + - `check_run.annotations.list` — annotations now inline in `pr.checks.list` output + - `pr.assignees.update` — replaced by `pr.assignees.add` + `pr.assignees.remove` + - `pr.threads.composite`, `issue.triage.composite`, `issue.update.composite` — composite infrastructure removed + + **Output schema changes:** + + - All rerun capabilities now return `{ runId: integer, queued: boolean }` (normalized) + - `pr.threads.reply` output now includes `commentId` and `commentUrl` + - `issue.relations.parent.set` output now includes `updated: boolean` + - `issue.relations.blocked_by.add` output now includes `added: boolean` + - `issue.milestone.set` no longer accepts `null` (use `issue.milestone.clear` instead) + +- 0b0335b: Add Claude Code plugin infrastructure for native plugin installation. + + - Move skill to `skills/using-ghx/SKILL.md` with plugin frontmatter, serving both `ghx setup` and Claude Code plugin + - Add `.claude-plugin/plugin.json` (package) and `.claude-plugin/marketplace.json` (repo root) + - Add `sync-plugin-manifests.mjs` to generate plugin manifests from `package.json` with `--check` mode for CI + - Remove redundant `dist/skills` copy (skills ship via `files` array at package root) + +- 871d369: Remove `@ghx-dev/core/agent` subpath export. All agent tools (`createExecuteTool`, `explainCapability`, `listCapabilities`) are now exported from `@ghx-dev/core`. The `MAIN_SKILL_TEXT` constant has been removed. +- bc10ce8: Standardize all issue mutation capabilities to accept `{ owner, name, issueNumber }` instead of `{ issueId }`. + + **Breaking input change** for: `issue.close`, `issue.reopen`, `issue.delete`, `issue.update`, `issue.labels.set`, `issue.labels.add`, `issue.labels.remove`, `issue.assignees.set`, `issue.assignees.add`, `issue.assignees.remove`, `issue.milestone.set`, `issue.comments.create`. + + Each capability now resolves the GitHub node ID internally via a Phase 1 lookup before executing the Phase 2 mutation. This matches the input contract of `issue.view` and enables `ResolutionCache` hits when capabilities are chained together in `executeTasks` calls. + +- 58cc7fe: Add structured JSONL execution logging. Emits typed log events at key points in the execution pipeline — preflight checks, route selection, adapter dispatch, all attempt failures (with `retryable` field), and results — written to `~/.ghx/logs/ghx-YYYY-MM-DD.jsonl`. Opt-in via `GHX_LOG_LEVEL` env var (debug/info/warn/error; unset = off). Log directory is configurable via `GHX_LOG_DIR`. + +### Patch Changes + +- fb05c12: Refactor CLI capability adapter into domain modules with full unit test coverage. + + **Refactoring:** + + - Split monolithic `cli-capability-adapter.ts` (2200+ lines) into focused domain modules under `core/execution/adapters/cli/domains/`: `repo.ts`, `issue.ts`, `pr.ts`, `workflow.ts`, `project-v2.ts`, `release.ts` + - Extracted shared arg-building helpers to `cli/helpers.ts` (`buildRepoArg`, `buildPaginationArgs`, `buildFieldsFlag`, etc.) + - Added `cli/capability-registry.ts` — auto-discovers all handlers by spreading domain `handlers` maps; `cli-capability-adapter.ts` becomes a thin dispatcher + + **Bug fixes:** + + - `pr.ts`: Use `rerunAllResult.exitCode` (not `result.exitCode`) in `handlePrChecksRerunFailed` fallback error path + - `project-v2.ts`: Remove unreachable `SyntaxError` catch branch in `handleProjectV2ItemFieldUpdate` (no JSON parsing on the success path) + - `release.ts`: Fix misleading error message — `owner`/`name` are already validated by `requireRepo`; only `releaseId` can be invalid at that point + - `workflow.ts`: Track total error/warning counts independently of the 10-line collection cap in `handleWorkflowJobLogsGet`; type-narrow artifact `id` field consistently with other normalized fields + + **Tests:** + + - Added comprehensive unit test suites for all six domain modules (`cli-domains-*.test.ts`) and for the shared helpers (`cli-helpers.test.ts`) and capability registry (`cli-capability-registry.test.ts`) — all modified files at ≥90% branch coverage + - Refactored e2e tests to use proper `afterEach`/`afterAll` lifecycle hooks instead of ESLint rule suppressions + + **Docs:** + + - Updated `docs/architecture/adapters.md` and `docs/architecture/repository-structure.md` to reflect the new domain module layout + +- bc10ce8: Fix `ghx chain` / `executeTasks` batch resolution aliasing bug. + + `buildBatchQuery` aliases each GraphQL root field (e.g. `repository`) as `step0`, `step1`, etc. GitHub returns the value directly under the alias key with no wrapper. The engine was storing the unwrapped value, causing `applyInject` to fail when traversing inject paths like `repository.issue.id` in subsequent steps. + + Fix: `extractRootFieldName()` is added to `batch.ts` and used in the Phase 1 un-alias loop to re-wrap the raw value as `{ [rootFieldName]: rawValue }` before storing it in `lookupResults`. Adds regression test using real batch/resolve implementations. + +- c4fbcaa: Refactor GQL layer: split monolithic client.ts into lazy-loaded domain modules, add capability registry dispatch, and rename common-types.ts to follow .generated convention. Import cost reduced from ~2,284 lines to ~220 lines via dynamic imports. +- 89344ca: Replace deep relative imports with `@core/*` path aliases for improved readability and maintainability. +- 7225358: Harden atomic chaining infrastructure based on review feedback: + + - Register `issue.assignees.add`/`remove` GraphQL handlers (types, mutations, client, capability registry) — these capabilities now route via GraphQL instead of falling back to CLI + - Fix `GraphqlError.path` type to `ReadonlyArray` per GraphQL spec + - Normalize `queryRaw` error handling — HTTP errors now settle consistently regardless of transport implementation + - Guard resolution cache against storing `undefined` and sweep expired entries before FIFO eviction + - Check `response.ok` before `response.json()` and wrap happy-path parse in try/catch for truncated responses + - Use strict `!== undefined` check for step errors instead of truthy check + - Extract `buildLookupVars` helper to eliminate duplication in engine + - Pass strings directly to `mapErrorToCode` instead of wrapping in `Error` + +- bc10ce8: Improve `pr.reviews.submit` schema and capabilities list output. + + - Add `startLine` and `startSide` fields to `pr.reviews.submit` for multi-line comment ranges + - Document the `side` vs `diffSide` naming asymmetry between submit input and `pr.threads.list` output + - Annotate `body` conditionality: required for `COMMENT`/`REQUEST_CHANGES`, optional for `APPROVE` + - Clarify `pr.reviews.list` description to note it returns review-level metadata only (not inline thread comments) + - Show array item field hints in `capabilities list` text output (e.g. `comments?[path, body, line, side?, startLine?, startSide?]`) + ## 0.1.2 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 61265845..9710157e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@ghx-dev/core", - "version": "0.1.2", + "version": "0.2.0", "description": "GitHub execution router for AI agents with deterministic routing and normalized output.", "author": "Arye Kogan", "license": "MIT",