Skip to content

feat(project): resolve all deployed resource types (prereq for project status) - #2158

Closed
jariy17 wants to merge 6 commits into
refactorfrom
feat/resolve-deployed-resources-all-types
Closed

feat(project): resolve all deployed resource types (prereq for project status)#2158
jariy17 wants to merge 6 commits into
refactorfrom
feat/resolve-deployed-resources-all-types

Conversation

@jariy17

@jariy17 jariy17 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the size/m PR size: M label Sep 1, 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 Sep 1, 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 Sep 1, 2026
@codecov-commenter

codecov-commenter commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.16981% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.25%. Comparing base (8dc1051) to head (0c1bd0d).
⚠️ Report is 13 commits behind head on refactor.

Files with missing lines Patch % Lines
src/core/project/backends/cdk.ts 96.34% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2158      +/-   ##
============================================
- Coverage     97.25%   97.25%   -0.01%     
============================================
  Files           508      508              
  Lines         33902    33974      +72     
============================================
+ Hits          32972    33041      +69     
- Misses          930      933       +3     

☔ 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.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 1, 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

Nice cleanup. The changes are cohesive and the design choices around graceful fallback are sensible:

  • The satisfies Record<CfnOutputResource, …> on EXPORT_PARTS gives us a compile-time guarantee that new DeployableResource variants can't silently resolve to "not found" — good future-proofing.
  • The .flatMap that drops resources without an id, combined with the explicit TODOs on capacity-provider and payment, makes the speculative export-name shapes for not-yet-emitted outputs (KnowledgeBase-*-Id, GatewayTarget-*-Id, ConfigBundle-*-Id, Dataset-*-Id, Payment…ManagerId, CapacityProvider-*-Id) safe: wrong guesses will manifest as an omitted row, not a crash.
  • Tests use temp dirs and only mock at real I/O boundaries (CDK runner, credential resolver, describeStack). Not excessive.
  • No telemetry needed — this PR is an internal API refactor with no new user-facing surface (allowMissing isn't wired to a consumer yet).

Two minor observations, not blockers:

  • EXPORT_PARTS["gateway-target"] ignores the parent gateway name (unlike policy, which threads it in). If the eventual CDK output for gateway targets includes the parent gateway (which it likely will, to avoid collisions when two gateways declare targets with the same name), this row will need updating along with l3-cdk-constructs#336. Fine to defer; just worth having on the radar when that output ships.
  • The Payment${toCdkId(name)}ManagerId OutputKey format is currently a prediction — no CfnOutput emitting it exists in either assets/cdk/lib/cdk-stack.ts or the L3 constructs. The comment acknowledges this, and it fails soft, so OK.

No changes required.

@jariy17
jariy17 marked this pull request as draft September 1, 2026 18:15
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 1, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

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

jariy17 added 3 commits September 1, 2026 21:08
…+harnesses

Broaden ProjectManager.resolveDeployedResources so it returns every deployed
resource (memory, knowledge-base, credential, evaluator, online-eval, gateway,
gateway-target, policy-engine, policy, config-bundle, dataset, payment) with its
physical id, alongside the existing runtimes and harnesses.

- Widen DeployedProjectResource.resourceType to a new DeployableResource union;
  add optional parent (policy->engine, gateway-target->gateway).
- Generalize findDeployedResourceId with an EXPORT_PARTS table typed
  'satisfies Record<CfnOutputResource, ...>' so a missing type is a COMPILE
  error, never a silent miss. ExportName format replicated from
  @aws/agentcore-cdk logical-ids (not importable: CDK lib, not a CLI dep).
- credential ids come from the deployed-state credentials map (never a stack
  output); payment matches by OutputKey (its CfnOutputs set no ExportName) with
  a TODO to add exportName in the cdk and fold it in.
- Add allowMissing so an undeployed target yields [] instead of throwing; deploy
  and remove keep the hard failure. Stack resolution unchanged (stackArn-from-state).
- Guard the invoke picker to only list runtime/harness now that the resolver
  returns more types.

This function will back the new 'agentcore project status' handler, which
returns a JSON status of the project's deployed resources to the customer.
Datasets are out of scope for 'agentcore project status', so remove them from
the resolver: the DeployableResource union, the EXPORT_PARTS table, the spec
iteration, and the resolver test. The 'satisfies Record<CfnOutputResource, ...>'
guard proves the union and the table stayed in sync after the removal.
findDeployedResourceId only knew CloudFormation exports, so its two
exceptions leaked outward: payment matched by OutputKey in an early
return, and credential -- which is never a stack output at all -- was
branched on by the caller. "Where does this id come from" lived in three
places.

Fold all fourteen types into one resolveResourceId switch that takes both
sources (the stack and deployed-state's credential ARNs). The `never`
default makes a new DeployableResource a compile error instead of a
resource that silently vanishes from `project status`.

Renamed off find* because it no longer only searches the stack. Export
name literals are unchanged -- each was verified against a real stack, so
they are deliberately not derived from the resourceType.
@jariy17
jariy17 force-pushed the feat/resolve-deployed-resources-all-types branch from eb01111 to 4d64751 Compare September 1, 2026 21:14
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 1, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 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 Sep 1, 2026
resolveResourceId had a single call site and took a two-source parameter
object (stack + credentialArns) purely to reach values that were already
locals there. Closing over them instead removes the parameter object.
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 1, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 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 Sep 1, 2026
project status surfaces these to customers, where an ARN is the useful
identifier. gateway-target stays on its id: AgentCoreMcp exports no -Arn
for it yet.
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 1, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 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 Sep 1, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 2, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 2, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 2, 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 Sep 2, 2026
@jariy17

jariy17 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #2165, which contains every commit from this branch (f52730c4 is an ancestor of aea9cf1c). Merging #2165 lands both the widened resolveDeployedResources and project status together.

@jariy17 jariy17 closed this Sep 2, 2026
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.

2 participants