Skip to content

feat(export): allow harness exports outside a project - #2542

Merged
aidandaly24 merged 11 commits into
aws:refactorfrom
aidandaly24:feat/harness-export-project
Oct 8, 2026
Merged

aidandaly24 merged 11 commits into
aws:refactorfrom
aidandaly24:feat/harness-export-project

Conversation

@aidandaly24

@aidandaly24 aidandaly24 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

Allow agentcore export harness --arn outside an AgentCore project by scaffolding a new project through the existing creation flow.

  • Default new project names start with Export, remove underscores from the Harness name and fit the existing 23-character limit. --project-name uses the supplied name unchanged.
  • Newly created deployment targets use the source Harness ARN's account and region. Existing projects and their targets remain unchanged.
  • Refuse existing destination directories and validate generated names before writing. Default agent names fit the deployed Runtime's 48-character name limit.
  • Preserve the shared progress and output behavior merged in fix(export): streamline harness export progress and output #2552, including clean JSON output and relative human-readable paths.

Scope: seven files. No agent-template, IAM capture, Memory/Gateway preservation, backend or CDK capability changes. This PR continues using the public @aws/agentcore-cdk dependency and does not require the unpublished preservation capability.

Infrastructure-preservation work is separate: CLI #2532 and CDK #415.

Related Issue

N/A. No new issue was requested.

Documentation PR

Generated command reference updated here. Changes to docs/harness-project-configuration.md were intentionally removed.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

Fresh scoped verification at a97abc79340199d19007db1396a0a692bac8424c:

  • 134 export/mapper/project/progress tests and 24 project-creation tests passed.
  • Typecheck, lint, formatting, secrets scan, build and command-reference parity passed.
  • Coverage retains default/custom names, source account/region precedence, deployment-name budgets, destination/content protection, failure-before-write behavior, TTY progress and JSON output.

The last full-suite attempt on an earlier head had 3,967 passes, 101 failures and 3 errors involving environment-limited port/subprocess behavior; selected failures also reproduced upstream. That result is not a full-suite pass or fresh validation of this head. No new AWS deployment/invocation validation was performed for this rebase. Resource-preservation validation belongs to the separate PR.

VHS Walkthrough

Real read-only ARN export using AWS_PROFILE=deploy, recorded from a fresh directory with the sealed build of this head. Shows the shared progress display, generated ExportAgentCoreCliRefac project, one Runtime entry, and the source account/region in the default deployment target. The 28-second MP4 and GIF were decoded and visually reviewed. This demonstrates export and local scaffolding, not deployment or agent invocation.

Harness export outside a project

Download the MP4.

Media is hosted on a separate demo branch; it does not add files to this PR's code diff.

  • I ran bun test (focused checks above; full-suite limitation disclosed)
  • I ran the relevant end-to-end tests with bun run test:e2e, or explained why they are not applicable (live read-only ARN export walkthrough above; no deployment/invocation)
  • I ran bun run typecheck
  • I ran bun run lint:check
  • I ran bun run format:check
  • I ran bun run build
  • If I modified src/assets/, I updated affected snapshots with bun test <test-file> --update-snapshots and committed them (assets unchanged)

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published (fix(export): streamline harness export progress and output #2552 merged; no unpublished preservation dependency)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@github-actions github-actions Bot added the size/m PR size: M label Oct 6, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Oct 6, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

I did not find any blocking issues. A few observations worth noting (non-blocking):

  • Partial-state cleanup after project creation (edge case). In src/core/project/manager.tsx (around L928–L1114), once yield* this.create({ name: projectName }) succeeds, a subsequent failure inside the export body only runs cleanupAgentDir() + envFile.rollback(). The newly-created project directory itself is left on disk. In practice, the steps after create() (template render → spec parse → write) are unlikely to fail — invalid inputs and service failures are all caught beforehand, and the tests cover those pre-creation paths well — so this is a rare case. If you want to tighten it, you could either (a) track whether the project was created in this call and rm -rf the destination on failure, or (b) run project creation last after you have a validated plan in hand. Up to you.

  • AgentCoreRegionSchema is a strict enum. If a future/unsupported region appears in the source ARN, AwsDeploymentTargetsSchema.parse(...) at L914 will throw after the GetHarness fetch has already happened. That's before this.create(...), so there's no partial state, but the user sees a validation failure after a successful service call. Probably fine since GetHarness would also fail in a region AgentCore doesn't support, but worth noting.

The test suite looks solid — real temp dirs, mocking kept at the harness SDK boundary, and good coverage of the "did we create a project when we shouldn't have" cases.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Oct 6, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Oct 6, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Oct 6, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Oct 7, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Oct 7, 2026
@aidandaly24
aidandaly24 force-pushed the feat/harness-export-project branch from e34157c to 31ecb98 Compare October 7, 2026 15:18
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Oct 7, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Oct 7, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Oct 7, 2026
@codecov-commenter

codecov-commenter commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.45%. Comparing base (4dbadfe) to head (a97abc7).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2542   +/-   ##
=========================================
  Coverage     97.44%   97.45%           
=========================================
  Files           645      645           
  Lines         47705    47779   +74     
=========================================
+ Hits          46488    46563   +75     
+ Misses         1217     1216    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Oct 7, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Oct 7, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot added claude-security-reviewing Claude Code /security-review in progress and removed claude-security-reviewing Claude Code /security-review in progress labels Oct 7, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Oct 7, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Oct 7, 2026
@aidandaly24
aidandaly24 force-pushed the feat/harness-export-project branch from 760fee5 to a97abc7 Compare October 7, 2026 19:24
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Oct 7, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Oct 7, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Oct 7, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Oct 7, 2026
@aidandaly24
aidandaly24 marked this pull request as ready for review October 7, 2026 20:32
@aidandaly24
aidandaly24 merged commit 1165a0f into aws:refactor Oct 8, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants