Skip to content

fix(scaffold): allow certain template values to be overriden - #5

Closed
Hweinstock wants to merge 8 commits into
refactor-templates-pt2from
feat/allow-flag-overrides
Closed

fix(scaffold): allow certain template values to be overriden#5
Hweinstock wants to merge 8 commits into
refactor-templates-pt2from
feat/allow-flag-overrides

Conversation

@Hweinstock

Copy link
Copy Markdown
Owner

Problem

Dependent on aws#2099. Likely will conflict with memory one.

Not all template fields that we'd expect to be able to overwrite are able to be overwritten. For example, in the create flow runtimeName is fixed since passing runtimeName + template is invalid.

Solution

allow all flags (except language and framework) to overwrite the template defaults.

  • refactor shortcuts into their own file since it no includes non-type specific logic.

Testing

  • unit tests
  • manual test of ./dist/bin/agentcore-linux-x64 project create --template strands-python --runtimeName bob --name testP now names the runtime correctly.

@github-actions github-actions Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Aug 27, 2026
notgitika and others added 4 commits August 27, 2026 02:00
…solution (aws#2122)

@aws-cdk/toolkit-lib's yaml-cfn.js does require("yaml/types") at import
time, a subpath that only exists in yaml v1. When an install topology
resolves toolkit-lib's yaml to the hoisted yaml v2 (whose exports map
blocks ./types), the module fails to load with
ERR_PACKAGE_PATH_NOT_EXPORTED ("Cannot find module 'yaml/types'").
This bites bun compile, which inlines toolkit-lib and embeds whatever
the build machine resolves.

Add a nested override forcing toolkit-lib's yaml to ^1 so it always
resolves the v1 nested copy that ships yaml/types.

Co-authored-by: gitikavj <gitikavj@amazon.com>
* feat: persist minimal deploy state to top-level deployed-state.json

Move the deploy-state file from agentcore/.cli/deployed-state.json to a
committed agentcore/deployed-state.json, and stop storing a full snapshot
of every resource. State is now keyed per target and holds only the
deployed CloudFormation stack ARN (captured from the toolkit deploy
result) plus the imperatively-created credential ARNs the synth step
needs. Everything else is read live from CloudFormation, so the file
never goes stale.

Adds a DeployedState schema with readDeployedState/updateTargetState
(merge-not-clobber, preserving sibling targets and unowned keys), surfaces
stackArn from the CDK toolkit runner, and points the vended CDK app at the
new path.

* fix: harden deployed-state integrity (review feedback)

Address review of the deployed-state work:
- Validate any existing state before deploy, so a malformed file fails
  before AWS is mutated rather than after (leaving the new stack ARN
  unrecorded). The vended app likewise only treats a missing file as
  absent and surfaces a malformed one.
- Require a stack ARN on a deploy result; a successful CDK deploy always
  has one, so its absence is malformed -- fail instead of silently
  skipping persistence.
- Write the state file atomically (temp + rename) so an interruption can't
  leave unparseable JSON that blocks later deploys.
- Passthrough the credential-entry schema so a stack-ARN-only rewrite
  doesn't strip fields a newer CLI records.
- Qualify the merge guarantee: safe for sequential deploys, not concurrent.

* refactor: keep deployed-state under agentcore/.cli/

Move the state file back under agentcore/.cli/ to match the released CLI's
location, so a project created by an older CLI keeps reading the same path
after upgrading (the vended app isn't re-vended on deploy). The scaffolded
.gitignore ignores the rest of .cli/ but re-includes deployed-state.json, so
the stack binding + credential ARNs stay committed and shared.

---------

Co-authored-by: gitikavj <gitikavj@amazon.com>
* feat: read project stack state live from CloudFormation

Adds a reader that describes a project's CloudFormation stack and
classifies its lifecycle into not-deployed / in-progress / failed / ready,
returning the stack outputs (resource ARNs/IDs) only when settled and
successful. This is the source-of-truth side of the deploy-state refactor:
resource details come from CloudFormation on demand rather than a local
snapshot that can go stale.

Generalizes the existing bootstrap not-found helper to isStackNotFound and
reuses it. No command is wired to this yet; project status consumes it in
a follow-up.

* refactor: trim reader to the raw DescribeStacks API

Per review, drop the stack-status classification (not-deployed / in-progress
/ failed / ready) and the StackState shape — that's a project status
interface decision and belongs with whoever builds it, not baked in ahead of
the consumer. Keep just describeStack: a DescribeStacks call that returns the
stack or undefined when it doesn't exist.

The CloudFormation call is injectable at the function seam (lazy-loaded like
environment.ts), so it's unit-tested without a real client; wiring it through
CoreClient/the project manager is left to the consumer.

* fix: throw on an empty successful DescribeStacks response

A missing stack is reported by a thrown ValidationError, so that stays the
only not-found (undefined) signal. A successful response with no stack is
malformed, not not-found; return undefined there would misreport a service
problem as 'not deployed'. Throw MalformedServiceResponseError instead,
matching the bootstrap reader.

---------

Co-authored-by: gitikavj <gitikavj@amazon.com>
* feat: support imperative eval recommendation command

* chore: leverage shared utils + delete stale tests

* fix: create recommendation input interface + update required flag handling
@Hweinstock
Hweinstock force-pushed the refactor-templates-pt2 branch from 812bee4 to 917cc91 Compare August 27, 2026 16:43
jariy17 and others added 3 commits August 27, 2026 12:57
…es/sessions (aws#2098)

* feat(eval): batch simulate — --ingestion-wait-ms flag + per-example failures/sessions

Follow-ups from the batch-evaluation simulate review:
- Add --ingestion-wait-ms (default 180000, 0 skips); thread via InvokeDatasetInput.waitIngestionMs.
  Removes the SIMULATE_INGESTION_WAIT_MS env var — tests pass the value through the input.
- runExamples now returns per-item failures (item + error), not a bare count + firstError; invokeDataset
  surfaces failures: [{ exampleId, error }] so a partial failure names which examples dropped and why.
- batch simulate output renders sessions[] (exampleId <-> sessionId join key for a later get) and
  failures[] (omitted when empty).

* chore: drop explanatory comments from batch simulate follow-up

* fix: always render failures[] in batch simulate output

* test(eval): simulate fixture golden via id seam + stream-aware recorder

- inject newSessionId into EvalClient (default randomUUID) so replay fixtures + goldens are deterministic
- teach makeRecordingSend to freeze/revive a streaming SDK response (InvokeAgentRuntime), which stringify couldn't serialize
- add simulate fixture-golden case; move handler edges to batch-evaluation.test.tsx
- split invokeDataset.test.ts into run.test.ts (pool) + load.test.ts (parse + GT-shape); delete it and simulate.test.tsx

* test(eval): drop run.test.ts + load.test.ts

* chore: drop explanatory comments from the simulate test refactor

* test(eval): simulate fixture asserts via matchGolden only (drop redundant expects)

---------

Co-authored-by: jariy17 <tjariy+jariy17@users.noreply.github.com>
* feat(templates): add support for dynamic templates

* docs(assets): update readme reccomended commands

* feat(runtime): wire up runtime version

* fix(templates): use key function to key templates

* docs(templates): fix comment with missing
the

* docs(templates): fix incorrect wording on template types

* fix(manager): render in correct directory

* test(template): add a snapshot test for the new template

* fix(template): avoid double nesting runtimes

* fix(templates): remove dead parameters

* refactor(harness): adapt harness to leverage template resolver

* refactor(manager): rename project template to project tree to avoid confusion

* fix(renderer): add missing handlebar helpers

* fix(templates): add harnesses to merge entries

* fix(handlebars): add missing helpers from upstream

* fix(harness): address hardcoded path

* fix(hello-world): reject non-HTTP protocol on template

* docs(strands-python): remove non-existent command from readme

* feat(template): install runtime dependencies in scaffolding

* fix(python): normalize names before being sent to python templates

* fix(templates): validate dockerfile for harness/

* fix(handlers): add strands as handler input

* fix(spec): avoid writing windows paths
@Hweinstock
Hweinstock force-pushed the feat/allow-flag-overrides branch from 0f8493c to f71c191 Compare August 27, 2026 19:53
@Hweinstock Hweinstock closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants